Examples of PermissionType


Examples of com.gitblit.Constants.PermissionType

    for (Map.Entry<String, AccessPermission> entry : permissions.entrySet()) {
      String registrant = entry.getKey();
      AccessPermission ap = entry.getValue();
      String source = null;
      boolean mutable = true;
      PermissionType pType = PermissionType.EXPLICIT;
      if (isMyPersonalRepository(registrant)) {
        pType = PermissionType.OWNER;
        ap = AccessPermission.REWIND;
        mutable = false;
      } else if (StringUtils.findInvalidCharacter(registrant) != null) {
View Full Code Here

Examples of com.gitblit.Constants.PermissionType

    }
    for (Map.Entry<String, AccessPermission> entry : permissions.entrySet()) {
      String registrant = entry.getKey();
      String source = null;
      boolean editable = true;
      PermissionType pType = PermissionType.EXPLICIT;
      if (StringUtils.findInvalidCharacter(registrant) != null) {
        // a regex will have at least 1 invalid character
        pType = PermissionType.REGEX;
        source = registrant;
      }
View Full Code Here

Examples of com.hazelcast.config.PermissionConfig.PermissionType

    }

    private void handleSecurityPermissions(final org.w3c.dom.Node node) throws Exception {
        for (org.w3c.dom.Node child : new IterableNodeList(node.getChildNodes())) {
            final String nodeName = cleanNodeName(child.getNodeName());
            PermissionType type;
            if ("map-permission".equals(nodeName)) {
                type = PermissionType.MAP;
            } else if ("queue-permission".equals(nodeName)) {
                type = PermissionType.QUEUE;
            } else if ("multimap-permission".equals(nodeName)) {
View Full Code Here

Examples of com.hazelcast.config.PermissionConfig.PermissionType

        private void handleSecurityPermissions(final Node node, final BeanDefinitionBuilder securityConfigBuilder) {
            final Set permissions = new ManagedSet();
            for (org.w3c.dom.Node child : new IterableNodeList(node.getChildNodes())) {
                final String nodeName = cleanNodeName(child.getNodeName());
                PermissionType type;
                if ("map-permission".equals(nodeName)) {
                    type = PermissionType.MAP;
                } else if ("queue-permission".equals(nodeName)) {
                    type = PermissionType.QUEUE;
                } else if ("multimap-permission".equals(nodeName)) {
View Full Code Here

Examples of com.hazelcast.config.PermissionConfig.PermissionType

    }

    private void handleSecurityPermissions(final org.w3c.dom.Node node) throws Exception {
        for (org.w3c.dom.Node child : new IterableNodeList(node.getChildNodes())) {
            final String nodeName = cleanNodeName(child.getNodeName());
            PermissionType type;
            if ("map-permission".equals(nodeName)) {
                type = PermissionType.MAP;
            } else if ("queue-permission".equals(nodeName)) {
                type = PermissionType.QUEUE;
            } else if ("multimap-permission".equals(nodeName)) {
View Full Code Here

Examples of com.hazelcast.config.PermissionConfig.PermissionType

        private void handleSecurityPermissions(final Node node, final BeanDefinitionBuilder securityConfigBuilder) {
            final Set permissions = new ManagedSet();
            for (org.w3c.dom.Node child : new IterableNodeList(node.getChildNodes())) {
                final String nodeName = cleanNodeName(child.getNodeName());
                PermissionType type = PermissionType.getType(nodeName);

                if (type == null) {
                    continue;
                }
View Full Code Here

Examples of com.hazelcast.config.PermissionConfig.PermissionType

    }

    private void handleSecurityPermissions(final org.w3c.dom.Node node) throws Exception {
        for (org.w3c.dom.Node child : new IterableNodeList(node.getChildNodes())) {
            final String nodeName = cleanNodeName(child.getNodeName());
            PermissionType type;
            if ("map-permission".equals(nodeName)) {
                type = PermissionType.MAP;
            } else if ("queue-permission".equals(nodeName)) {
                type = PermissionType.QUEUE;
            } else if ("multimap-permission".equals(nodeName)) {
View Full Code Here

Examples of domain.PermissionType

  @Override
  protected Response internalExecute(HttpServletRequest request, Session databaseSession) {
    Response response = null;
    try {
      // New event creation:
      PermissionType permisssionTypeObject = (PermissionType) databaseSession.createCriteria(PermissionType.class)
                                            .add(Restrictions.eq("id", this.permissionType))
                                            .uniqueResult();

      RepetitionType repetitionTypeObject = (RepetitionType) databaseSession.createCriteria(RepetitionType.class)
                                            .add(Restrictions.eq("id", this.repetitionType))
                                            .uniqueResult();
     
      EventType eventTypeObject = (EventType) databaseSession.createCriteria(EventType.class)
                                  .add(Restrictions.eq("id", this.eventType))
                                  .uniqueResult();
      Date fromDate = DateOperator.stringToDate(this.from);
      Date toDate = DateOperator.stringToDate(this.to);
   
      if( (null == fromDate) || (null == toDate) ) {
        throw new IllegalArgumentException("Date has wrong format");
      }
      if( !DateOperator.date1IsBeforeDate2(fromDate, toDate) ) {
        throw new IllegalArgumentException("From date should be before to date");
      }
      if( !DateOperator.isRepetitionPossible(fromDate, toDate, repetitionTypeObject) ) {
        return new Response(ResponseStatus.FAIL, "Repetition is not possible. Make sure there is a sense in the repetition type you choose");
      }
     
      User oldOwner = (User) databaseSession.get(User.class, this.oldOwner);

      if (oldOwner == null) {
        throw new IllegalArgumentException("Couldn't locate old owner of the event");
      }
     
      EventType oldEventType = (EventType) databaseSession.get(EventType.class, this.oldEventType);
     
      if (oldEventType == null) {
        throw new IllegalArgumentException("Couldn't locate old type of the event");
      }
     
      Event oldEvent = (Event) databaseSession.createCriteria(Event.class)
                    .add(Restrictions.eq("id.from", DateOperator.stringToDate(this.oldFrom) ))
                    .add(Restrictions.eq("id.to", DateOperator.stringToDate(this.oldTo)))
                    .add(Restrictions.eq("id.type", oldEventType))
                    .add(Restrictions.eq("id.owner", oldOwner))
                    .uniqueResult();
     
      if (oldEvent == null) {
        throw new IllegalArgumentException("Could not locate event in question!");
      }
     
      User currentUser = (User) request.getSession().getAttribute("currentUser");
     
      if (currentUser == null) {
        throw new SecurityException("You're not logged in");
      }

      // get permission types from database (very very dumb):
      PermissionType publicPermission = (PermissionType) databaseSession.get(PermissionType.class, new Long(1));
     
      // get admin role, yep, dumb as well.
      Role adminRole = (Role) databaseSession.get(Role.class, new Long(2));
     
      // who can edit the event:
View Full Code Here

Examples of domain.PermissionType

        eventIdObject.setFrom(fromDate);
        eventIdObject.setTo(toDate);
        eventIdObject.setOwner(userObject);
        eventIdObject.setType(eventTypeObject);
       
        PermissionType permisssionTypeObject = (PermissionType) databaseSession.createCriteria(PermissionType.class).add(Restrictions.eq("id", this.permissionType)).uniqueResult();
        if(null == permisssionTypeObject) {
          return new Response(ResponseStatus.FAIL, "Not valid permisssion type");
        }
       
        RepetitionType repetitionTypeObject = (RepetitionType) databaseSession.createCriteria(RepetitionType.class).add(Restrictions.eq("id", this.repetitionType)).uniqueResult();
View Full Code Here

Examples of domain.PermissionType

       
        // get current user
        User currentUser = (User) request.getSession().getAttribute("currentUser");
       
        // get permission types from database (very very dumb):
        PermissionType publicPermission = (PermissionType) databaseSession.get(PermissionType.class, new Long(1));
       
        // get admin role, yep, dumb as well.
        Role adminRole = (Role) databaseSession.get(Role.class, new Long(2));
       
        // who can edit the event:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.