Use extracted new convenience method for Role existance check by string
This commit is contained in:
parent
874d91537b
commit
db8887e3b1
|
@ -159,10 +159,9 @@ public class UserSitesToGroupsAndRolesMapper {
|
|||
log.info("Checking actual roles in the site's group");
|
||||
for (String gcRoleName : actualSiteGroupRoles) {
|
||||
String actualSiteName = actualSite.getName();
|
||||
// 'D4ScienceMappings.Role.valueOf(gcRoleName) != null' is used to be sure that is a d4s role and not
|
||||
// 'D4ScienceMappings.Role.exists(gcRoleName)' is used to be sure that is a d4s role and not
|
||||
// a Liferay role that must be let as it is
|
||||
if (D4ScienceMappings.Role.valueOf(gcRoleName) != null
|
||||
&& !actualSite.getRoles().contains(gcRoleName)) {
|
||||
if (D4ScienceMappings.Role.exists(gcRoleName) && !actualSite.getRoles().contains(gcRoleName)) {
|
||||
try {
|
||||
log.info("Removing '" + gcRoleName + "' user's role for site: " + actualSiteName);
|
||||
roleManager.removeRoleFromUser(user.getUserId(), actualSiteGroupId,
|
||||
|
|
Loading…
Reference in New Issue