Package org.jboss.security.identity.plugins

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


        
         if(roleset != null)
         {
            for(String r:roleset)
            {
               newRoles.addRole(new SimpleRole(r));           
            }
         }
        
         mappedObject.clearRoles();
         mappedObject.getRoles().addAll(newRoles.getRoles());
View Full Code Here


               int len = tokens != null ? tokens.length : 0;
               for(int i = 0; i < len; i++)
               {
                  if(this.REPLACE_ROLES)
                     removeMembers.add(r);
                  addMembers.add(new SimpleRole(tokens[i]));
               }
            } 
         }
      }
     
View Full Code Here

      // 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 = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
      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

         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());
            if(methodRoles.containsRole(myRole))
               return AuthorizationContext.PERMIT;
         }
         return AuthorizationContext.DENY;
      }
View Full Code Here

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

   }
  
   public static RoleGroup getRoleGroup(String rolename)
   {
      SimpleRoleGroup srg = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
      srg.getRoles().add(new SimpleRole(rolename));
      return srg;
   }
View Full Code Here

      // 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

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.