Examples of containsRole()


Examples of org.jboss.security.identity.RoleGroup.containsRole()

         log.debug("authorize " + resource + " " + subject + " " + role);
         EJBResource ejbResource = (EJBResource) resource;
         RoleGroup methodRoles = ejbResource.getEjbMethodRoles();
         if(methodRoles == null)
            return AuthorizationContext.PERMIT;
         if(methodRoles.containsRole(SimpleRole.ANYBODY_ROLE))
            return AuthorizationContext.PERMIT;
         if (subject != null)
         {
            for(Principal p : subject.getPrincipals())
            {
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup.containsRole()

         {
            for(Principal p : subject.getPrincipals())
            {
               // TODO: not really true, but for the moment lets assume that the principal is also the role
               Role myRole = new SimpleRole(p.getName());
               if(methodRoles.containsRole(myRole))
                  return AuthorizationContext.PERMIT;
            }
         }
         if (ejbResource.getCallerRunAsIdentity() != null)
         {
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup.containsRole()

         log.debug("authorize " + resource + " " + subject + " " + role);
         EJBResource ejbResource = (EJBResource) resource;
         RoleGroup methodRoles = ejbResource.getEjbMethodRoles();
         if(methodRoles == null)
            return AuthorizationContext.PERMIT;
         if(methodRoles.containsRole(SimpleRole.ANYBODY_ROLE))
            return AuthorizationContext.PERMIT;
         for(Principal p : subject.getPrincipals())
         {
            // TODO: not really true, but for the moment lets assume that the principal is also the role
            Role myRole = new SimpleRole(p.getName());
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup.containsRole()

            return AuthorizationContext.PERMIT;
         for(Principal p : subject.getPrincipals())
         {
            // TODO: not really true, but for the moment lets assume that the principal is also the role
            Role myRole = new SimpleRole(p.getName());
            if(methodRoles.containsRole(myRole))
               return AuthorizationContext.PERMIT;
         }
         return AuthorizationContext.DENY;
      }
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup.containsRole()

      assertNotNull("Mapping Context is not null", mc);
      mc.performMapping(map, grp);
     
      grp = (RoleGroup) mc.getMappingResult().getMappedObject();
     
      assertFalse("oldRole does not exist", grp.containsRole(new SimpleRole("oldRole")));
      assertTrue("t1 exists?",grp.containsRole(new SimpleRole("t1")));
      assertTrue("t2 exists?",grp.containsRole(new SimpleRole("t2")));
   }
  
   public void testAttributeProvider()
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup.containsRole()

      mc.performMapping(map, grp);
     
      grp = (RoleGroup) mc.getMappingResult().getMappedObject();
     
      assertFalse("oldRole does not exist", grp.containsRole(new SimpleRole("oldRole")));
      assertTrue("t1 exists?",grp.containsRole(new SimpleRole("t1")));
      assertTrue("t2 exists?",grp.containsRole(new SimpleRole("t2")));
   }
  
   public void testAttributeProvider()
   {
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup.containsRole()

     
      grp = (RoleGroup) mc.getMappingResult().getMappedObject();
     
      assertFalse("oldRole does not exist", grp.containsRole(new SimpleRole("oldRole")));
      assertTrue("t1 exists?",grp.containsRole(new SimpleRole("t1")));
      assertTrue("t2 exists?",grp.containsRole(new SimpleRole("t2")));
   }
  
   public void testAttributeProvider()
   {
      SecurityConfiguration.addApplicationPolicy(createApplicationPolicy(securityDomain));
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRoleGroup.containsRole()

      {
         if(callerRunAs instanceof RunAsIdentity)
         {
            RunAsIdentity callerRunAsIdentity = (RunAsIdentity) callerRunAs;
            SimpleRoleGroup srg = new SimpleRoleGroup(callerRunAsIdentity.getRunAsRoles());
            allowed = srg.containsRole(deploymentrole);
            //allowed = callerRunAsIdentity.doesUserHaveRole(set);
         }
      }
      return allowed ? AuthorizationContext.PERMIT : AuthorizationContext.DENY;
   }
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRoleGroup.containsRole()

      {
         if(callerRunAs instanceof RunAsIdentity)
         {
            RunAsIdentity callerRunAsIdentity = (RunAsIdentity) callerRunAs;
            SimpleRoleGroup srg = new SimpleRoleGroup(callerRunAsIdentity.getRunAsRoles());
            allowed = srg.containsRole(deploymentrole);
         }
      }
      return allowed ? AuthorizationContext.PERMIT : AuthorizationContext.DENY;
   }
}
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRoleGroup.containsRole()

   {
      Role aRole = new SimpleRole("aRole");

      SimpleRoleGroup srg = new SimpleRoleGroup("Roles");
      srg.addRole(SimpleRole.ANYBODY_ROLE);
      assertTrue(srg.containsRole(aRole));
   }

   public void testNestedRoles()
   {
      SimpleRoleGroup srg = new SimpleRoleGroup("nested");
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.