diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/util/UserUtil.java b/src/main/java/org/gcube/portlets/user/workspace/server/util/UserUtil.java index 569acdf..6f572ad 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/util/UserUtil.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/util/UserUtil.java @@ -208,10 +208,6 @@ public class UserUtil { // get highest role RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles); - // if the role is member, continue - if(correspondentRoleToCheck.equals(RolesIntoOrganization.MEMBER)) - continue; - checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, correspondentRoleToCheck, workspaceInstance, groupManager, gCubeGroup.getGroupId(), orgsInWhichAtLeastEditorRole); } @@ -233,10 +229,6 @@ public class UserUtil { // get highest role RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles); - // if the role is member, continue - if(correspondentRoleToCheck.equals(RolesIntoOrganization.MEMBER)) - continue; - checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, correspondentRoleToCheck, workspaceInstance, groupManager, gCubeGroup.getGroupId(), orgsInWhichAtLeastEditorRole); } @@ -249,12 +241,8 @@ public class UserUtil { // get highest role RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles); - // if it the role is ADMIN we have to be sure to set it - if(correspondentRoleToCheck.equals(RolesIntoOrganization.ADMIN)){ - - checkIfRoleIsSetInCkanInstance(username, groupName, correspondentRoleToCheck, workspaceInstance, - groupManager, currentGroupId, orgsInWhichAtLeastEditorRole); - } + checkIfRoleIsSetInCkanInstance(username, groupName, correspondentRoleToCheck, workspaceInstance, + groupManager, currentGroupId, orgsInWhichAtLeastEditorRole); } }catch(Exception e){ logger.error("Unable to retrieve the role information for this user. Returning false", e); @@ -295,8 +283,8 @@ public class UserUtil { // if there is an instance of ckan in this scope.. if(ckanUtils != null){ boolean res = ckanUtils.checkRole(username, gCubeGroupName, correspondentRoleToCheck); - if(res){ - + + if(res && !correspondentRoleToCheck.equals(RolesIntoOrganization.MEMBER)){ // get the orgs of the user List ckanOrgs = ckanUtils.getOrganizationsByUser(username); for (CkanOrganization ckanOrganization : ckanOrgs) {