/** * Replace the principals in first group with those in the second * @param fg * @param sg * @return */ public static Group replacePrincipals(Group fg, Group sg) { return addPrincipals( removePrincipals(fg),sg.members()); }
/** * Add the roles into the Group * @param roles Group of roles * @param addRoles * @return Group with the added roles */ public static Group addRoles(Group roles, String[] addRoles) { Class<?> pClass = getPrincipalClass(roles); for(String str:addRoles) { roles.addMember(instantiatePrincipal(pClass,str)); } return roles; }
if(commaSeparatedRoles != null) String[] tokens = MappingProviderUtil.getRolesFromCommaSeparatedString(commaSeparatedRoles); int len = tokens != null ? tokens.length : 0; for(int i = 0; i < len; i++)
/** * Add the roles into the Group * @param roles Group of roles * @param addRoles * @return Group with the added roles */ public static Group addRoles(Group roles, String[] addRoles) { Class<?> pClass = getPrincipalClass(roles); for(String str:addRoles) { roles.addMember(instantiatePrincipal(pClass,str)); } return roles; }
/** * Replace the principals in first group with those in the second * @param fg * @param sg * @return */ public static Group replacePrincipals(Group fg, Group sg) { return addPrincipals( removePrincipals(fg),sg.members()); }
if(commaSeparatedRoles != null) String[] tokens = MappingProviderUtil.getRolesFromCommaSeparatedString(commaSeparatedRoles); int len = tokens != null ? tokens.length : 0; for(int i = 0; i < len; i++)
/** * Remove the roles from the Group * @param roles Group of roles * @param removeRoles * @return Group with roles removed */ public static Group removeRoles(Group roles, String[] removeRoles) { //Assume that the roles all belong to the same principal class Class<?> pClass = getPrincipalClass(roles); for(String str:removeRoles) { roles.removeMember(instantiatePrincipal(pClass,str)); } return roles; }
/** * Remove the roles from the Group * @param roles Group of roles * @param removeRoles * @return Group with roles removed */ public static Group removeRoles(Group roles, String[] removeRoles) { //Assume that the roles all belong to the same principal class Class<?> pClass = getPrincipalClass(roles); for(String str:removeRoles) { roles.removeMember(instantiatePrincipal(pClass,str)); } return roles; }