Package org.jboss.security.identity

Examples of org.jboss.security.identity.Identity


      if(ids != null)
      {
         Iterator<Identity> iter = ids.iterator();
         while(iter.hasNext())
         {
            Identity id = iter.next();
            if(clazz.isAssignableFrom(id.getClass()))
               this.securityContext.getSubjectInfo().removeIdentity(id);
         }
      } 
   }
View Full Code Here


      if(ids != null)
      {
         Iterator<Identity> iter = ids.iterator();
         while(iter.hasNext())
         {
            Identity id = iter.next();
            if(clazz.isAssignableFrom(id.getClass()))
               resultSet.add(id);
         }
      }
      return resultSet;
   }
View Full Code Here

      // using the authorization manager, check if the identities have the expected permissions.
      JBossAuthorizationManager jam = new JBossAuthorizationManager("test-acl");

      // check that Administrator has all permissions on both resources.
      Identity identity = IdentityFactory.createIdentity("Administrator");
      assertEquals(AuthorizationContext.PERMIT, jam.authorize(resource1, identity, new CompositeACLPermission(
            BasicACLPermission.values())));
      assertEquals(AuthorizationContext.PERMIT, jam.authorize(resource2, identity, new CompositeACLPermission(
            BasicACLPermission.values())));
View Full Code Here

    * @throws Exception if an error occurs when running the test.
    */
   public void testACLUseCases() throws Exception
   {
      // we start by filtering the resources by the identity.
      Identity identity = this.identities[0];
      TestResource[] filteredResources = this.filterResources(identity);
      assertEquals("Unexpected number of resources", TOTAL_RESOURCES / 2, filteredResources.length);
      for (TestResource resource : filteredResources)
      {
         // the "even" identity must be able to see only the "even" resources.
View Full Code Here

      // none of john's roles has DELETE permission, so he should not be able to delete resource 0.
      assertFalse(provider.isAccessGranted(this.resources[0], this.identity, BasicACLPermission.DELETE));

      // now create a new identity for john that has no roles. The role-based provider should now use the
      // identity name (default impl) when checking for permissions.
      Identity identity = IdentityFactory.createIdentity("john");
      assertTrue(provider.isAccessGranted(this.resources[1], identity, new CompositeACLPermission(BasicACLPermission
            .values())));
      // access should be denied to resource 0, as that one has an ACL based on the roles.
      assertFalse(provider.isAccessGranted(this.resources[0], identity, BasicACLPermission.READ));
   }
View Full Code Here

        Principal principal = util.getUserPrincipal();
        Object credential = util.getCredential();

        boolean authenticated = false;
        if (principal == null) {
            Identity unauthenticatedIdentity = getUnauthenticatedIdentity();
            subjectInfo.addIdentity(unauthenticatedIdentity);
            subject.getPrincipals().add(unauthenticatedIdentity.asPrincipal());
            authenticated = true;
        }

        if (authenticated == false) {
            AuthenticationManager authenticationManager = context.getAuthenticationManager();
View Full Code Here

        Principal principal = util.getUserPrincipal();
        Object credential = util.getCredential();

        boolean authenticated = false;
        if (principal == null) {
            Identity unauthenticatedIdentity = getUnauthenticatedIdentity();
            subjectInfo.addIdentity(unauthenticatedIdentity);
            subject.getPrincipals().add(unauthenticatedIdentity.asPrincipal());
            authenticated = true;
        }

        if (authenticated == false) {
            AuthenticationManager authenticationManager = context.getAuthenticationManager();
View Full Code Here

      if(ids != null)
      {
         Iterator<Identity> iter = ids.iterator();
         while(iter.hasNext())
         {
            Identity id = iter.next();
            if(clazz.isAssignableFrom(id.getClass()))
               resultSet.add(id);
         }
         ids.removeAll(resultSet);
     
   }
View Full Code Here

      if(ids != null)
      {
         Iterator<Identity> iter = ids.iterator();
         while(iter.hasNext())
         {
            Identity id = iter.next();
            if(clazz.isAssignableFrom(id.getClass()))
               resultSet.add(id);
         }
      }
      return resultSet;
   }
View Full Code Here

TOP

Related Classes of org.jboss.security.identity.Identity

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.