Package org.jboss.security.acl

Examples of org.jboss.security.acl.ACLImpl


   {
      Set<ACL> configuredACLs = new HashSet<ACL>();
      for (ACLDefinition definition : this.definitions.values())
      {
         Set<ACLEntry> entries = this.getEntries(definition, new ArrayList<String>());
         ACLImpl acl = new ACLImpl(definition.getResource(), entries);
         configuredACLs.add(acl);
      }
      return configuredACLs;
   }
View Full Code Here


         Set<ACL> acls = this.contextIDToACLs.remove(contextID);
         if (acls != null)
         {
            for (ACL acl : acls)
            {
               ACLImpl impl = (ACLImpl) acl;
               this.configuredACLs.remove(impl.getResourceAsString());
            }
         }
         if (trace)
            log.trace("Deregistered ACLs for contextId:" + contextID);
      }
View Full Code Here

         Set<ACL> configuredACLs = configuration.getConfiguredACLs();
         // register the configured ACLs
         this.contextIDToACLs.put(contextID, configuredACLs);
         for (ACL acl : configuredACLs)
         {
            ACLImpl impl = (ACLImpl) acl;
            if (trace)
               log.trace("Registering ACL for resource " + impl.getResourceAsString());
            this.configuredACLs.put(impl.getResourceAsString(), acl);
         }
      }
   }
View Full Code Here

         Set<ACL> acls = this.contextIDToACLs.remove(contextID);
         if (acls != null)
         {
            for (ACL acl : acls)
            {
               ACLImpl impl = (ACLImpl) acl;
               this.configuredACLs.remove(impl.getResourceAsString());
            }
         }
         if (trace)
            log.trace("Deregistered ACLs for contextId:" + contextID);
      }
View Full Code Here

         Set<ACL> configuredACLs = configuration.getConfiguredACLs();
         // register the configured ACLs
         this.contextIDToACLs.put(contextID, configuredACLs);
         for (ACL acl : configuredACLs)
         {
            ACLImpl impl = (ACLImpl) acl;
            if (trace)
               log.trace("Registering ACL for resource " + impl.getResourceAsString());
            this.configuredACLs.put(impl.getResourceAsString(), acl);
         }
      }
   }
View Full Code Here

         Set<ACL> configuredACLs = configuration.getConfiguredACLs();
         // register the configured ACLs
         this.contextIDToACLs.put(contextId, configuredACLs);
         for (ACL acl : configuredACLs)
         {
            ACLImpl impl = (ACLImpl) acl;
            if (trace)
               log.trace("Registering ACL for resource " + impl.getResourceAsString());
            this.configuredACLs.put(impl.getResourceAsString(), acl);
         }
      }
   }
View Full Code Here

         Set<ACL> acls = this.contextIDToACLs.remove(contextID);
         if (acls != null)
         {
            for (ACL acl : acls)
            {
               ACLImpl impl = (ACLImpl) acl;
               this.configuredACLs.remove(impl.getResourceAsString());
            }
         }
         if (trace)
            log.trace("Deregistered ACLs for contextId:" + contextID);
      }
View Full Code Here

         Set<ACL> configuredACLs = configuration.getConfiguredACLs();
         // register the configured ACLs
         this.contextIDToACLs.put(contextID, configuredACLs);
         for (ACL acl : configuredACLs)
         {
            ACLImpl impl = (ACLImpl) acl;
            if (trace)
               log.trace("Registering ACL for resource " + impl.getResourceAsString());
            this.configuredACLs.put(impl.getResourceAsString(), acl);
         }
      }
   }
View Full Code Here

         Set<ACL> configuredACLs = configuration.getConfiguredACLs();
         // register the configured ACLs
         this.contextIDToACLs.put(contextId, configuredACLs);
         for (ACL acl : configuredACLs)
         {
            ACLImpl impl = (ACLImpl) acl;
            if (trace)
               log.trace("Registering ACL for resource " + impl.getResourceAsString());
            this.configuredACLs.put(impl.getResourceAsString(), acl);
         }
      }
   }
View Full Code Here

      boolean validatedJavaCompEnvACL = false;

      // validate the two ACLs returned.
      for (ACL acl : configuredACLs)
      {
         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());
      }
      assertTrue("org.jboss.jnp.NamingService:java/comp ACL has not been validated", validatedJavaCompACL);
      assertTrue("org.jboss.jnp.NamingService:java/comp/env ACL has not been validated", validatedJavaCompEnvACL);
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.acl.ACLImpl

Copyright © 2018 www.massapicom. 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.