Examples of ACLEntry


Examples of org.apache.wiki.auth.acl.AclEntry

            Enumeration entries = acl.entries();
            Collection<AclEntry> entriesToAdd    = new ArrayList<AclEntry>();
            Collection<AclEntry> entriesToRemove = new ArrayList<AclEntry>();
            while ( entries.hasMoreElements() )
            {
                AclEntry entry = (AclEntry)entries.nextElement();
                if ( ArrayUtils.contains( oldPrincipals, entry.getPrincipal() ) )
                {
                    // Create new entry
                    AclEntry newEntry = new AclEntryImpl();
                    newEntry.setPrincipal( newPrincipal );
                    Enumeration permissions = entry.permissions();
                    while ( permissions.hasMoreElements() )
                    {
                        Permission permission = (Permission)permissions.nextElement();
                        newEntry.addPermission(permission);
                    }
                    pageChanged = true;
                    entriesToRemove.add( entry );
                    entriesToAdd.add( newEntry );
                }
            }
            for ( Iterator ix = entriesToRemove.iterator(); ix.hasNext(); )
            {
                AclEntry entry = (AclEntry)ix.next();
                acl.removeEntry( entry );
            }
            for ( Iterator ix = entriesToAdd.iterator(); ix.hasNext(); )
            {
                AclEntry entry = (AclEntry)ix.next();
                acl.addEntry( entry );
            }
        }
        return pageChanged;
    }
View Full Code Here

Examples of org.jboss.security.acl.ACLEntry

         ACLImpl aclImpl = (ACLImpl) acl;
         if (aclImpl.getResourceAsString().equals("org.jboss.test.authorization.acl.ACLTestResource:10"))
         {
            assertEquals("Invalid number of entries", 2, aclImpl.getEntries().size());
            // one entry should assign the CREATE,READ,UPDATE,DELETE permissions to Administrator.
            ACLEntry entry = aclImpl.getEntry(IdentityFactory.createIdentity("Administrator"));
            assertNotNull("Unexpected null value for Administrator entry", entry);
            CompositeACLPermission expectedPermission = new CompositeACLPermission(BasicACLPermission.values());
            assertEquals("Unexpected permissions assigned for Administrator", expectedPermission, entry.getPermission());
            // the other entry should assign the READ permission to Guest.
            entry = aclImpl.getEntry(IdentityFactory.createIdentity("Guest"));
            assertNotNull("Unexpected null value for Guest entry", entry);
            expectedPermission = new CompositeACLPermission(BasicACLPermission.READ);
            assertEquals("Unexpected permissions assigned for Guest", expectedPermission, entry.getPermission());
            validatedJavaCompACL = true;
         }
         else if (aclImpl.getResourceAsString().equals("org.jboss.test.authorization.acl.ACLTestResource:20"))
         {
            assertEquals("Invalid number of entries", 3, aclImpl.getEntries().size());
            // one entry should assign the CREATE,READ,UPDATE,DELETE permissions to Administrator.
            ACLEntry entry = aclImpl.getEntry(IdentityFactory.createIdentity("Administrator"));
            assertNotNull("Unexpected null value for Administrator entry", entry);
            CompositeACLPermission expectedPermission = new CompositeACLPermission(BasicACLPermission.values());
            assertEquals("Unexpected permissions assigned for Administrator", expectedPermission, entry.getPermission());
            // one other entry should assign the READ,UPDATE permissions to Guest.
            entry = aclImpl.getEntry(IdentityFactory.createIdentity("Guest"));
            assertNotNull("Unexpected null value for Guest entry", entry);
            expectedPermission = new CompositeACLPermission(BasicACLPermission.READ, BasicACLPermission.UPDATE);
            assertEquals("Unexpected permissions assigned for Guest", expectedPermission, entry.getPermission());
            // the final entry should assign the READ,UPDATE permissions to Regular_User.
            entry = aclImpl.getEntry(IdentityFactory.createIdentity("Regular_User"));
            assertNotNull("Unexpected null value for Regular_User entry", entry);
            expectedPermission = new CompositeACLPermission(BasicACLPermission.READ, BasicACLPermission.UPDATE);
            assertEquals("Unexpected permissions assigned for Regular_User", expectedPermission, entry.getPermission());
            validatedJavaCompEnvACL = true;
         }
         else
            fail("Invalid ACL found: " + aclImpl.getResourceAsString());
      }
View Full Code Here

Examples of org.openntf.domino.ACLEntry

    setAcl(acl);
  }

  private ACLEntry getNext() {
    if (nextEntry_ == null) {
      ACLEntry currentEntry = getCurrentEntry();
      ACL acl = getAcl();
      try {
        if (currentEntry == null) {
          if (isDone()) {
            nextEntry_ = null;
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.