Fixed retrieve role methods
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@129305 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
49590c8632
commit
c6586b9a47
|
@ -267,7 +267,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
UserManager userManager = new LiferayUserManager();
|
UserManager userManager = new LiferayUserManager();
|
||||||
RoleManager roleManager = new LiferayRoleManager();
|
RoleManager roleManager = new LiferayRoleManager();
|
||||||
GroupManager groupManager = new LiferayGroupManager();
|
GroupManager groupManager = new LiferayGroupManager();
|
||||||
List<GCubeRole> roles = roleManager.listRolesByUserAndGroup(groupManager.getGroupId(groupName), userManager.getUserId(username));
|
List<GCubeRole> roles = roleManager.listRolesByUserAndGroup(userManager.getUserId(username), groupManager.getGroupId(groupName));
|
||||||
|
|
||||||
logger.debug("The list of roles for " + username + " into " + groupName + " is " + roles);
|
logger.debug("The list of roles for " + username + " into " + groupName + " is " + roles);
|
||||||
|
|
||||||
|
@ -279,11 +279,11 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
||||||
for (GCubeRole role : roles) {
|
for (GCubeRole role : roles) {
|
||||||
|
|
||||||
logger.debug("User " + username + " has role " + role.getRoleName() + " in " + currentScope);
|
logger.debug("User " + username + " has role " + role.getRoleName() + " in " + currentScope);
|
||||||
if(role.getRoleName().contains(CkanRolesIntoLiferay.CATALOG_ADMIN.toString())){
|
if(role.getRoleName().equalsIgnoreCase(CkanRolesIntoLiferay.CATALOG_ADMIN.toString())){
|
||||||
mainRole = CkanRolesIntoLiferay.CATALOG_ADMIN;
|
mainRole = CkanRolesIntoLiferay.CATALOG_ADMIN;
|
||||||
correspondentRoleToCheck = RolesIntoOrganization.ADMIN;
|
correspondentRoleToCheck = RolesIntoOrganization.ADMIN;
|
||||||
break;
|
break;
|
||||||
}else if(role.getRoleName().contains(CkanRolesIntoLiferay.CATALOG_EDITOR.toString())){
|
}else if(role.getRoleName().equalsIgnoreCase(CkanRolesIntoLiferay.CATALOG_EDITOR.toString())){
|
||||||
mainRole = CkanRolesIntoLiferay.CATALOG_EDITOR;
|
mainRole = CkanRolesIntoLiferay.CATALOG_EDITOR;
|
||||||
correspondentRoleToCheck = RolesIntoOrganization.EDITOR;
|
correspondentRoleToCheck = RolesIntoOrganization.EDITOR;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue