minor fix when checking roles
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@131764 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d7884b6ad2
commit
24565db7ff
|
@ -208,10 +208,6 @@ public class UserUtil {
|
||||||
// get highest role
|
// get highest role
|
||||||
RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
|
RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
|
||||||
|
|
||||||
// if the role is member, continue
|
|
||||||
if(correspondentRoleToCheck.equals(RolesIntoOrganization.MEMBER))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, correspondentRoleToCheck, workspaceInstance,
|
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, correspondentRoleToCheck, workspaceInstance,
|
||||||
groupManager, gCubeGroup.getGroupId(), orgsInWhichAtLeastEditorRole);
|
groupManager, gCubeGroup.getGroupId(), orgsInWhichAtLeastEditorRole);
|
||||||
}
|
}
|
||||||
|
@ -233,10 +229,6 @@ public class UserUtil {
|
||||||
// get highest role
|
// get highest role
|
||||||
RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
|
RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
|
||||||
|
|
||||||
// if the role is member, continue
|
|
||||||
if(correspondentRoleToCheck.equals(RolesIntoOrganization.MEMBER))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, correspondentRoleToCheck, workspaceInstance,
|
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, correspondentRoleToCheck, workspaceInstance,
|
||||||
groupManager, gCubeGroup.getGroupId(), orgsInWhichAtLeastEditorRole);
|
groupManager, gCubeGroup.getGroupId(), orgsInWhichAtLeastEditorRole);
|
||||||
}
|
}
|
||||||
|
@ -249,12 +241,8 @@ public class UserUtil {
|
||||||
// get highest role
|
// get highest role
|
||||||
RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
|
RolesIntoOrganization correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
|
||||||
|
|
||||||
// if it the role is ADMIN we have to be sure to set it
|
checkIfRoleIsSetInCkanInstance(username, groupName, correspondentRoleToCheck, workspaceInstance,
|
||||||
if(correspondentRoleToCheck.equals(RolesIntoOrganization.ADMIN)){
|
groupManager, currentGroupId, orgsInWhichAtLeastEditorRole);
|
||||||
|
|
||||||
checkIfRoleIsSetInCkanInstance(username, groupName, correspondentRoleToCheck, workspaceInstance,
|
|
||||||
groupManager, currentGroupId, orgsInWhichAtLeastEditorRole);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("Unable to retrieve the role information for this user. Returning false", 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 there is an instance of ckan in this scope..
|
||||||
if(ckanUtils != null){
|
if(ckanUtils != null){
|
||||||
boolean res = ckanUtils.checkRole(username, gCubeGroupName, correspondentRoleToCheck);
|
boolean res = ckanUtils.checkRole(username, gCubeGroupName, correspondentRoleToCheck);
|
||||||
if(res){
|
|
||||||
|
if(res && !correspondentRoleToCheck.equals(RolesIntoOrganization.MEMBER)){
|
||||||
// get the orgs of the user
|
// get the orgs of the user
|
||||||
List<CkanOrganization> ckanOrgs = ckanUtils.getOrganizationsByUser(username);
|
List<CkanOrganization> ckanOrgs = ckanUtils.getOrganizationsByUser(username);
|
||||||
for (CkanOrganization ckanOrganization : ckanOrgs) {
|
for (CkanOrganization ckanOrganization : ckanOrgs) {
|
||||||
|
|
Loading…
Reference in New Issue