Package org.jboss.security.identity.plugins

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


      // First check that role is not a NobodyPrincipal
      if (role instanceof NobodyPrincipal)
         return false;
     
      // Check for inclusion in the user's role set
      boolean isMember = userRoles.containsRole(new SimpleRole(role.getName()));
      if (isMember == false)
      {   // Check the AnybodyPrincipal special cases
         isMember = (role instanceof AnybodyPrincipal);
      }
     
View Full Code Here


      if(source == null && toCopy != null)
         source = this.getEmptyRoleGroup();
      Enumeration<? extends Principal> en = toCopy.members();
      while(en.hasMoreElements())
      {
         source.addRole(new SimpleRole(en.nextElement().getName()));
      }
      
      return source;
   }
View Full Code Here

         throw new IllegalArgumentException("roleGroup is null");
      SimpleRoleGroup srg = new SimpleRoleGroup(roleGroup.getName());
      Enumeration<? extends Principal> principals = roleGroup.members();
      while(principals.hasMoreElements())
      {
         srg.getRoles().add(new SimpleRole(principals.nextElement().getName()));
      }
      return srg; 
   }
View Full Code Here

            log.trace("no match found for security role " + roleName +
                  " in the deployment descriptor for ejb " + this.ejbName);
         }
      }
      Role deploymentrole = new SimpleRole(roleName);

      boolean allowed = false;
      if (callerRunAs == null)
         allowed = principalRole.containsRole(deploymentrole);
      else
View Full Code Here

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

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

      List<Role> roleList = srg.getRoles();
     
      for(String role:roles)
      {
         roleList.add(new SimpleRole(role));  
      }
      return srg;
   }
View Full Code Here

      HashMap<String,Object> map = new HashMap<String,Object>();
      map.put(SecurityConstants.PRINCIPAL_IDENTIFIER, principal);
      map.put(SecurityConstants.DEPLOYMENT_PRINCIPAL_ROLES_MAP, rolesMap);
     
      RoleGroup grp = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
      grp.addRole(new SimpleRole("oldRole"));

      MappingContext<RoleGroup> mc = sc.getMappingManager().getMappingContext(RoleGroup.class);
      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")));
   }
View Full Code Here

  
   public void testRoles()
   {
      JBossSecurityContext sc = this.getSC("other");
      SimpleRoleGroup roleGroup = new SimpleRoleGroup("Roles");
      roleGroup.addRole(new SimpleRole("testRole"));
      sc.getUtil().setRoles(roleGroup);
     
      //Retrieve the roles
      RoleGroup scRoles = sc.getUtil().getRoles();
      assertNotNull(scRoles);
      assertTrue(scRoles.containsAll(new SimpleRole("testRole")));
   }
View Full Code Here

   {
      if(subject == null)
         return AuthorizationContext.DENY;
      if(resource.getLayer() == ResourceType.WEB)
      {
         if(role != null && role.containsAll(new SimpleRole("ServletUserRole")))
            return AuthorizationContext.PERMIT;
      }
      return AuthorizationContext.DENY;
   }
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.