Package org.jboss.security

Examples of org.jboss.security.SimpleGroup.addMember()


    String roles = (String) options.get(ROLES_OPT + suffix);
    if (roles != null) {
      Group rolesGroup = new SimpleGroup(SecurityHelper.ROLES_GROUP_NAME);
      String[] rolesArray = roles.split(",");
      for (String role : rolesArray) {
        rolesGroup.addMember(new SimplePrincipal(role));
      }
      subject.getPrincipals().add(rolesGroup);
    }

    // in any case, clean out state
View Full Code Here


    @Override
    protected Group[] getRoleSets() throws LoginException {
        Group roles = new SimpleGroup("Roles");
        Group callerPrincipal = new SimpleGroup("CallerPrincipal");
        Group[] groups = { roles, callerPrincipal };
        callerPrincipal.addMember(getIdentity());
        return groups;
    }

    private Properties loadProperties(final String name) throws IOException {
        ClassLoader classLoader = SecurityActions.getContextClassLoader();
View Full Code Here

    @Override
    protected Group[] getRoleSets() throws LoginException {
        Group roles = new SimpleGroup("Roles");
        Group callerPrincipal = new SimpleGroup("CallerPrincipal");
        Group[] groups = { roles, callerPrincipal };
        callerPrincipal.addMember(getIdentity());
        return groups;
    }

}
View Full Code Here

    try
    {
      Group roles = new SimpleGroup("Roles");
      for (String role : this.identity.getRoles())
      {
        roles.addMember(this.createIdentity(role));
      }

      Group[] groups = { roles };

      return groups;
View Full Code Here

         Group newRoles = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
         Iterator iter = roleset.iterator();
         while(iter.hasNext())
         {
            String rolename = (String)iter.next();
            newRoles.addMember(createNewPrincipal(mappedObject,rolename));
         }
         mappedObject = MappingProviderUtil.replacePrincipals(mappedObject, newRoles)
      }
      result.setMappedObject(mappedObject);
   }
View Full Code Here

  protected Group[] adicionarUsuarioGrupo(Funcionario funcionario){
    if (funcionario == null)
      throw new IllegalArgumentException("Usuario null");
   
    SimpleGroup sg = new SimpleGroup("Roles");   
    sg.addMember(new SimplePrincipal(funcionario.getCargo()));
 
    return new Group[]{sg};
 
}
View Full Code Here

      {
         StringTokenizer tokenizer = new StringTokenizer(roleNames, ",");
         while( tokenizer.hasMoreTokens() )
         {
            String roleName = tokenizer.nextToken();
            roles.addMember(new SimplePrincipal(roleName));
         }
      }
      return roleSets;
   }
}
View Full Code Here

      Group group = new SimpleGroup("Roles");
      Iterator itRoleNames = getSecurityRoleNames().iterator();
      while (itRoleNames.hasNext())
      {
         String roleName = (String) itRoleNames.next();
         group.addMember(new SimplePrincipal(roleName));
      }

      return new Group[]{group};
   }
View Full Code Here

    protected Group[] getRoleSets() throws LoginException {

        SimpleGroup roles = new SimpleGroup("Roles");

        for (String role : rolesList ) {
            roles.addMember( new SimplePrincipal(role));
        }
        Group[] roleSets = { roles };
        return roleSets;
    }
View Full Code Here

      SimplePrincipal sp2 = new SimplePrincipal("sp2");
     
      SimpleGroup sg1 = new SimpleGroup("sg1");
      SimpleGroup sg2 = new SimpleGroup("sg1");
      sg1.addMember(sp1);
      sg2.addMember(sp2);
      NestableGroup ng = new NestableGroup("TestGroup");
      //Add principals to the NestablePrincipal
      ng.addMember(sg1);
      ng.addMember(sg2);
      assertTrue("ng.isMember(sp2)", ng.isMember(sp2));
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.