Package org.jboss.security.identity.plugins

Examples of org.jboss.security.identity.plugins.SimpleRole


   }
  
   private RoleGroup getRoleGroup()
   {
      RoleGroup rg = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
      rg.addRole(new SimpleRole("ServletUserRole"));
      return rg;
   }
View Full Code Here


   }
  
   private RoleGroup getRoleGroup()
   {
      RoleGroup rg = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
      rg.getRoles().add(new SimpleRole("ServletUserRole"));
      return rg;
   }
View Full Code Here

      assertEquals("Role names are different", identity.getRole().getRoleName(), restored.getRole().getRoleName());
   }

   public void testReadIdentityWithRoleAndParent() throws Exception
   {
      Role parent = new SimpleRole("parent");
      Role role = new SimpleRole("testRole", parent);
      Identity identity = IdentityFactory.createIdentityWithRole(identityName, role);
      assertFalse("File already exists", file.exists());
      assertNotNull("Failed to persist", ps.persistIdentity(identity));
      assertTrue("File was not created", file.exists());
View Full Code Here

      assertTrue(RoleFactory.createRoleGroup("myRoleGroup") instanceof SimpleRoleGroup);
   }

   public void testSimpleRoleContains() throws Exception
   {
      Role firstRole = new SimpleRole("A");
      Role secondRole = new SimpleRole("B");

      assertTrue(firstRole.containsAll(firstRole));
      assertFalse(firstRole.containsAll(secondRole));
      assertFalse(secondRole.containsAll(firstRole));
   }
View Full Code Here

   }

   public void testSimpleRoleGroupContains() throws Exception
   {
      SimpleRoleGroup firstRoleGroup = new SimpleRoleGroup("firstrg");
      firstRoleGroup.getRoles().add(new SimpleRole("A"));
      firstRoleGroup.getRoles().add(new SimpleRole("B"));
      firstRoleGroup.getRoles().add(new SimpleRole("C"));

      SimpleRoleGroup secondRoleGroup = new SimpleRoleGroup("secondrg");
      secondRoleGroup.getRoles().add(new SimpleRole("A"));
      secondRoleGroup.getRoles().add(new SimpleRole("B"));

      assertTrue(firstRoleGroup.containsAll(firstRoleGroup));
      assertTrue(secondRoleGroup.containsAll(secondRoleGroup));
      assertTrue(firstRoleGroup.containsAll(secondRoleGroup));
      assertFalse(secondRoleGroup.containsAll(firstRoleGroup));
View Full Code Here

   }

   public void testSimpleRoleGroup()
   {
      SimpleRoleGroup srg = new SimpleRoleGroup("Roles");
      srg.addRole(new SimpleRole("aRole"));
      assertTrue(srg.containsAll(new SimpleRole("aRole")));
   }
View Full Code Here

                    AttributeType attribute = obj.getAttribute();
                    if (attribute != null) {
                        // if this is a role attribute, get its values and add them to the role set.
                        if (tokenRoleAttributeName.equals(attribute.getName())) {
                            for (Object value : attribute.getAttributeValue()) {
                                rolesGroup.addRole(new SimpleRole((String) value));
                            }
                        }
                    }
                }
                result.setMappedObject(rolesGroup);
View Full Code Here

TOP

Related Classes of org.jboss.security.identity.plugins.SimpleRole

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.