Principal p = (Principal)en.nextElement();
String roleName = p.getName();
log.debug("$$Processing role principal object related to current user: " + roleName);
//check if such role is present
Role role = null;
try
{
role = getRoleModule().findRoleByName(roleName);
}
catch (Exception e)
{
//
}
if (role == null)
{
try
{
role = getRoleModule().createRole(roleName, roleName);
}
catch (Throwable e)
{
log.warn("Error when trying to synchronize role: " + roleName, e);
continue;
}
}
rolesToAssign.add(role);
userRoles.addMember(createIdentity(role.getName()));
}
}
}
if (defaultAssignedRole != null)