/** * Create the set of roles the user belongs to by parsing the roles.properties * data for username=role1,role2,... * * @param username - name of user * @param roleGroup - group containing the user's roles * @param roles - the Properties containing the user=roles mappings * @return Group[] containing the sets of roles */ static void addRolesToGroup(String username, RoleGroup roleGroup, Properties roles) { String[] roleNames = null; if (roles.containsKey(username)) { String value = roles.getProperty(username); PicketBoxLogger.LOGGER.traceAdditionOfRoleToGroup(value, roleGroup.getRoleName()); roleNames = parseRoles(value); } if (roleNames != null) { for (int i = 0; i < roleNames.length; i++) { roleGroup.addRole(new SimpleRole(roleNames[i])); } } }