minor fix to get highestRole function
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@133974 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b3aaea9b04
commit
9cc90eaae1
|
@ -116,10 +116,6 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
|||
public static final String SELECTION_STATE_ATTRIBUTE = "WORKSPACE.SELECTION_STATE";
|
||||
protected Logger workspaceLogger = Logger.getLogger(GWTWorkspaceServiceImpl.class);
|
||||
|
||||
// for the data catalogue
|
||||
private static final String CKAN_ROLE = "ckanRole"; // a true value means the user has admin role, false means member
|
||||
private static final String CKAN_ORGANIZATIONS_PUBLISH_KEY = "ckanOrganizationsPublish"; // here he can publish
|
||||
|
||||
/**
|
||||
* Gets the GWT workspace builder.
|
||||
*
|
||||
|
|
|
@ -208,6 +208,9 @@ public class UserUtil {
|
|||
// get highest role
|
||||
RolesCkanGroupOrOrg correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
|
||||
|
||||
if(correspondentRoleToCheck.equals(RolesCkanGroupOrOrg.MEMBER))
|
||||
continue;
|
||||
|
||||
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, correspondentRoleToCheck, workspaceInstance,
|
||||
groupManager, gCubeGroup.getGroupId(), orgsInWhichAtLeastEditorRole);
|
||||
}
|
||||
|
@ -229,6 +232,9 @@ public class UserUtil {
|
|||
// get highest role
|
||||
RolesCkanGroupOrOrg correspondentRoleToCheck = getLiferayHighestRoleInOrg(roles);
|
||||
|
||||
if(correspondentRoleToCheck.equals(RolesCkanGroupOrOrg.MEMBER))
|
||||
continue;
|
||||
|
||||
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, correspondentRoleToCheck, workspaceInstance,
|
||||
groupManager, gCubeGroup.getGroupId(), orgsInWhichAtLeastEditorRole);
|
||||
}
|
||||
|
@ -283,7 +289,7 @@ public class UserUtil {
|
|||
// if there is an instance of ckan in this scope..
|
||||
if(catalogue != null){
|
||||
boolean res = catalogue.checkRoleIntoOrganization(username, gCubeGroupName, correspondentRoleToCheck);
|
||||
|
||||
|
||||
if(res && !correspondentRoleToCheck.equals(RolesCkanGroupOrOrg.MEMBER)){
|
||||
// get the orgs of the user
|
||||
List<CkanOrganization> ckanOrgs = catalogue.getOrganizationsByUser(username);
|
||||
|
|
Loading…
Reference in New Issue