minor fix on role retrieval
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@142015 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
911a1b976f
commit
c9aada8099
|
@ -4,6 +4,9 @@
|
|||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<dependent-module archiveName="ckan-metadata-publisher-widget-1.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-metadata-publisher-widget/ckan-metadata-publisher-widget">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="context-root" value="gcube-ckan-datacatalog"/>
|
||||
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</wb-module>
|
||||
|
|
|
@ -254,6 +254,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
}
|
||||
}
|
||||
|
||||
logger.debug("Returning highest role " + toReturn);
|
||||
|
||||
// return the role
|
||||
return toReturn;
|
||||
|
|
|
@ -105,6 +105,7 @@ public class UserUtil {
|
|||
userManager.getUserByEmail(userEMail).getUsername(),
|
||||
mapRoleByGroupExtrasVre).
|
||||
start();
|
||||
|
||||
logger.debug("Returning Map to the ckan connector : " + mapRoleByGroupSingleVre);
|
||||
return mapRoleByGroupSingleVre;
|
||||
}catch (UserManagementSystemException | UserRetrievalFault | GroupRetrievalFault e) {
|
||||
|
@ -168,12 +169,7 @@ public class UserUtil {
|
|||
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, gCubeGroup.getGroupId(),
|
||||
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl, orgsInWhichAtLeastEditorRole);
|
||||
|
||||
if(toReturn.equals(RolesCkanGroupOrOrg.ADMIN))
|
||||
continue;
|
||||
else if(toReturn.equals(RolesCkanGroupOrOrg.EDITOR) && correspondentRoleToCheck.equals(RolesCkanGroupOrOrg.ADMIN))
|
||||
toReturn = RolesCkanGroupOrOrg.ADMIN;
|
||||
else // it was MEMBER
|
||||
toReturn = correspondentRoleToCheck;
|
||||
toReturn = RolesCkanGroupOrOrg.getHigher(toReturn, correspondentRoleToCheck);
|
||||
|
||||
}
|
||||
|
||||
|
@ -198,12 +194,7 @@ public class UserUtil {
|
|||
checkIfRoleIsSetInCkanInstance(username, gCubeGroupName, gCubeGroup.getGroupId(),
|
||||
correspondentRoleToCheck, groupManager, gcubeCkanDataCatalogServiceImpl, orgsInWhichAtLeastEditorRole);
|
||||
|
||||
if(toReturn.equals(RolesCkanGroupOrOrg.ADMIN))
|
||||
continue;
|
||||
else if(toReturn.equals(RolesCkanGroupOrOrg.EDITOR) && correspondentRoleToCheck.equals(RolesCkanGroupOrOrg.ADMIN))
|
||||
toReturn = RolesCkanGroupOrOrg.ADMIN;
|
||||
else
|
||||
toReturn = correspondentRoleToCheck;
|
||||
toReturn = RolesCkanGroupOrOrg.getHigher(toReturn, correspondentRoleToCheck);
|
||||
}
|
||||
|
||||
}else if(groupManager.isVRE(currentGroupId)){
|
||||
|
|
|
@ -40,15 +40,10 @@ public class AddUserToOrganizationThread extends Thread {
|
|||
logger.debug("Thread for role association started. Organizations and roles are in the map: " + orgAndCapacity);
|
||||
Set<Entry<String, String>> entrySet = orgAndCapacity.entrySet();
|
||||
for (Entry<String, String> entry : entrySet) {
|
||||
|
||||
if(instance.getOrganizationByName(entry.getKey()) != null)
|
||||
instance.checkRoleIntoOrganization(username, entry.getKey(), RolesCkanGroupOrOrg.convertFromCapacity(entry.getValue()));
|
||||
|
||||
}
|
||||
logger.debug("Thread for role association ended");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue