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