Package org.jboss.security

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


         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


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

   private Group getGroupFromRoleSet(Set<Principal> roleset)
   {
      Group gp = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
      for(Principal p: roleset)
      {
         gp.addMember(p);
      }
      return gp;
   }
}
View Full Code Here

            SimpleGroup sg = new SimpleGroup("Roles");

            Set<RealmRole> roles = sui.getSubject().getPrincipals(RealmRole.class);
            for (RealmRole current : roles) {
                sg.addMember(createIdentity(current.getName()));
            }

            return new Group[]{sg};
        } catch (Exception e) {
            throw SecurityMessages.MESSAGES.failureCallingSecurityRealm(e.getMessage());
View Full Code Here

    public void testNobody()
    {
        System.out.println("testNobody");
        SimpleGroup nobodyGroup = new SimpleGroup("<NOBODY>");
        SimplePrincipal nobody = new SimplePrincipal("<NOBODY>");
        nobodyGroup.addMember(nobody);
        group.addMember(nobodyGroup);
        boolean isMember = group.isMember(NobodyPrincipal.NOBODY_PRINCIPAL);
        assertTrue("NobodyPrincipal.isMember == false", isMember == false);
    }
View Full Code Here

   @Override
   protected Group[] getRoleSets()
   {
      SimpleGroup roles = new SimpleGroup("Roles");
      Group[] roleSets = {roles};
      roles.addMember(new SimplePrincipal("TestRole"));
      roles.addMember(new SimplePrincipal("Role2"));
      return roleSets;
   }

   @Override
View Full Code Here

   protected Group[] getRoleSets()
   {
      SimpleGroup roles = new SimpleGroup("Roles");
      Group[] roleSets = {roles};
      roles.addMember(new SimplePrincipal("TestRole"));
      roles.addMember(new SimplePrincipal("Role2"));
      return roleSets;
   }

   @Override
   protected String getUsersPassword() throws LoginException
View Full Code Here

     @Override
   protected Group[] getRoleSets()
     {
        SimpleGroup roles = new SimpleGroup("Roles");
        Group[] roleSets = {roles};
        roles.addMember(new SimplePrincipal("TestRole"));
        roles.addMember(new SimplePrincipal("Role2"));
        return roleSets;
     }
     /** This represents the 'true' password
      */
 
View Full Code Here

   protected Group[] getRoleSets()
     {
        SimpleGroup roles = new SimpleGroup("Roles");
        Group[] roleSets = {roles};
        roles.addMember(new SimplePrincipal("TestRole"));
        roles.addMember(new SimplePrincipal("Role2"));
        return roleSets;
     }
     /** This represents the 'true' password
      */
     @Override
View Full Code Here

            subjectGroup.addMember(role);
         }
      }
      // add the CallerPrincipal group if none has been added in getRoleSets
      Group callerGroup = new SimpleGroup(SecurityConstants.CALLER_PRINCIPAL_GROUP);
      callerGroup.addMember(identity);
      principals.add(callerGroup);
      SecurityContext sc = SecurityContextAssociation.getSecurityContext();
      Principal userPrincipal = getPrincipal(subject);
      sc.getUtil().createSubjectInfo(userPrincipal, credentials, subject);
      List<String> rolesAsStringList = new ArrayList<String>();
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.