Examples of Permission


Examples of org.exist.security.Permission

      try {
      modifyMetadata(new ModifyMetadata() {

        @Override
        public void modify(DocumentImpl resource) throws IOException {
          Permission perm = resource.getPermissions();
          try {
                        perm.setMode(perm.getMode() | (READ << 6) & ~(WRITE << 6));
                    } catch (PermissionDeniedException e) {
                        throw new IOException(e);
                    }
        }

        @Override
        public void modify(Collection collection) throws IOException {
          Permission perm = collection.getPermissionsNoLock();
          try {
                        perm.setMode(perm.getMode() | (READ << 6) & ~(WRITE << 6));
                    } catch (PermissionDeniedException e) {
                        throw new IOException(e);
                    }
        }
       
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL.Permission

        uiPopup.setUIComponent(uiMembershipSelector);
        uiMembershipSelector.setId("PermissionSelector");
        uiMembershipSelector.getChild(UITree.class).setId("TreePermissionSelector");
        uiMembershipSelector.getChild(UIBreadcumbs.class).setId("BreadcumbsPermissionSelector");

        permission_ = new Permission();
    }
View Full Code Here

Examples of org.gatein.api.security.Permission

        if (getSite(pageId.getSiteId()) == null) {
            throw new EntityNotFoundException("Site " + pageId.getSiteId() + " doesn't exist");
        }

        Permission access = Permission.everyone();
        Permission edit = Permission.any("platform", "administrators");
        PageState pageState = new PageState(pageId.getPageName(), null, false, null, Arrays.asList(Util.from(access)),
            Util.from(edit)[0]);

        PageImpl p = new PageImpl(new PageContext(Util.from(pageId), pageState));
        p.setCreate(true);
View Full Code Here

Examples of org.glyptodon.guacamole.net.auth.permission.Permission

        // Add connection permissions
        for (String identifier : configs.keySet()) {

            // Create permission
            Permission permission = new ConnectionPermission(
                ObjectPermission.Type.READ,
                identifier
            );

            // Add to set
            permissions.add(permission);

        }

        // Add group permissions
        for (ConnectionGroup group : groups) {

            // Create permission
            Permission permission = new ConnectionGroupPermission(
                ObjectPermission.Type.READ,
                group.getIdentifier()
            );

            // Add to set
View Full Code Here

Examples of org.jboss.seam.security.permission.Permission

        
         for (String action : selectedActions)
         {
            if (!originalActions.contains(action))
            {
               grantedPermissions.add(new Permission(target, action, recipient));
            }
         }
        
         for (String action : originalActions)
         {
            if (!selectedActions.contains(action))
            {
               revokedPermissions.add(new Permission(target, action, recipient));
            }
         }
        
         if (!grantedPermissions.isEmpty()) permissionManager.grantPermissions(grantedPermissions);
         if (!revokedPermissions.isEmpty()) permissionManager.revokePermissions(revokedPermissions);
      }
      // otherwise this is a set of new permissions
      else
      {
         if (selectedActions.size() == 0)
         {
            FacesMessages.instance().add("You must select at least one action");
            return "failure";
         }
        
         List<Permission> permissions = new ArrayList<Permission>();
  
         for (String role : selectedRoles)
         {
            Principal r = new Role(role);
            for (String action : selectedActions)
            {           
               permissions.add(new Permission(target, action, r));
            }
         }
        
         for (Member friend : selectedFriends)
         {
            MemberAccount acct = (MemberAccount) entityManager.createQuery(
                  "select a from MemberAccount a where a.member = :member")
                  .setParameter("member", friend)
                  .getSingleResult();
           
            Principal p = new SimplePrincipal(acct.getUsername());
           
            for (String action : selectedActions)
            {
               permissions.add(new Permission(target, action, p));
            }
         }
        
         permissionManager.grantPermissions(permissions);
      }
View Full Code Here

Examples of org.jclouds.ec2.domain.Permission

   private StringBuilder currentText = new StringBuilder();
   private Set<String> userIds = Sets.newHashSet();
   private Set<String> groups = Sets.newHashSet();

   public Permission getResult() {
      return new Permission(userIds, groups);
   }
View Full Code Here

Examples of org.jdesktop.wonderland.modules.security.common.Permission

                {
                    return Access.GRANT;
                }

                // find the permission for this principal
                Permission perm = getPermission(p, action);
                if (perm != null) {
                    // now check if the permission is a user permission.  If
                    // it is, it means it was a permission specifically for
                    // this user, and therefore should be applied directly
                    // and not combined with any other permissions.
                    if (perm.getPrincipal().getType() == Principal.Type.USER) {
                        return perm.getAccess();
                    }

                    // if the permission is a group or everybody permission,
                    // put it on the list to combine later
                    myPerms.add(perm);
                }
            }

            // now go through all the group permissions. If there are any
            // positive group permissions, this means that at least one of
            // the groups this user is a member of has access to the content,
            // so access should be granted
            boolean hasGroupPerm = false;
            for (Iterator<Permission> i = myPerms.iterator(); i.hasNext();) {
                Permission perm = i.next();

                if (perm.getPrincipal().getType() == Principal.Type.GROUP) {
                    hasGroupPerm = true;
                    i.remove();

                    if (perm.getAccess() == Access.GRANT) {
                        return Access.GRANT;
                    }
                }
            }

            // at this point, if there was a group permission defined, we know
            // that it was a DENY because otherwise we would have returned
            // above.  That means that the user wasn't part of any groups
            // that had permission, but was part of at least one group that
            // was denied permission.  In this case, we should deny access.
            if (hasGroupPerm) {
                return Access.DENY;
            }

            // last, we check for any remaining permissionm, which must
            // be everyone permissions. There is no way to combine these, so
            // just go with whatever the first one says (hopefully there is
            // only one)
            for (Permission perm : myPerms) {
                return perm.getAccess();
            }
           
            // if we get here, it means that there were no permissions for
            // this user, any of the user's groups or everybody.  In that case,
            // return undefined (null).
View Full Code Here

Examples of org.jets3t.service.acl.Permission

    Iterator grantIter = originalAccessControlList.getGrants().iterator();
    while (grantIter.hasNext()) {
      GrantAndPermission gap = (GrantAndPermission) grantIter.next();
      GranteeInterface grantee = gap.getGrantee();
      Permission permission = gap.getPermission();
      if (grantee instanceof CanonicalGrantee) {
        canonicalGranteeTableModel.addGrantee(grantee, permission);
      } else if (grantee instanceof EmailAddressGrantee) {
        emailGranteeTableModel.addGrantee(grantee, permission);
      } else if (grantee instanceof GroupGrantee) {
View Full Code Here

Examples of org.jets3t.service.impl.soap.axis._2006_03_01.Permission

                grant.setGrantee(customerByEmail);
            } else {
                throw new S3ServiceException("Unrecognised jets3t grantee type: "
                    + jets3tGrantee.getClass());
            }
            Permission permission = Permission.fromString(jets3tGaP.getPermission().toString());
            grant.setPermission(permission);
            grants[index++] = grant;
        }
        return grants;
    }
View Full Code Here

Examples of org.jivesoftware.openfire.component.ExternalComponentConfiguration.Permission

     * @return true if the external component with the specified subdomain can connect to the
     *         local server.
     */
    public static boolean canAccess(String subdomain) {
        // By default there is no permission defined for the XMPP entity
        Permission permission = null;

        ExternalComponentConfiguration config = getConfiguration(subdomain, true);
        if (config != null) {
            permission = config.getPermission();
        }
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.