Package org.jboss.security

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


        Group callerPrincipal = new SimpleGroup("CallerPrincipal");
        callerPrincipal.addMember(new SimplePrincipal(username));
        principals.add(callerPrincipal);
        Group roles = new SimpleGroup("Roles");
        if (username.equals("anil"))
            roles.addMember(new SimplePrincipal("gooduser"));
        if (username.equals("marcus"))
            roles.addMember(new SimplePrincipal("superuser"));
        principals.add(roles);
        return true;
    }
View Full Code Here


        principals.add(callerPrincipal);
        Group roles = new SimpleGroup("Roles");
        if (username.equals("anil"))
            roles.addMember(new SimplePrincipal("gooduser"));
        if (username.equals("marcus"))
            roles.addMember(new SimplePrincipal("superuser"));
        principals.add(roles);
        return true;
    }

    @Override
View Full Code Here

      List<String> roles = ServiceProviderSAMLContext.getRoles();
      if(roles != null)
      {
         for(String role: roles)
         {
            group.addMember(new SimplePrincipal(role));
         }
      }
      return new Group[] {group};
   }
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

      {
         StringTokenizer tokenizer = new StringTokenizer(roleNames, ",");
         while( tokenizer.hasMoreTokens() )
         {
            String roleName = tokenizer.nextToken();
            roles.addMember(new SimplePrincipal(roleName));
         }
      }
      return roleSets;
   }
}
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

            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

      {
         boolean authenticated = (Boolean)options.get("authenticated");
         if (authenticated)
         {
            Group roles = new SimpleGroup("Roles");
            roles.addMember(new JAASSecurityManager.SimplePrincipal((String)options.get("role")));
            subject.getPrincipals().add(roles);
         }
         return authenticated;

      }
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

    @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

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.