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();
|
||||
RoleManager roleManager = new LiferayRoleManager();
|
||||
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);
|
||||
|
||||
|
@ -279,11 +279,11 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
for (GCubeRole role : roles) {
|
||||
|
||||
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;
|
||||
correspondentRoleToCheck = RolesIntoOrganization.ADMIN;
|
||||
break;
|
||||
}else if(role.getRoleName().contains(CkanRolesIntoLiferay.CATALOG_EDITOR.toString())){
|
||||
}else if(role.getRoleName().equalsIgnoreCase(CkanRolesIntoLiferay.CATALOG_EDITOR.toString())){
|
||||
mainRole = CkanRolesIntoLiferay.CATALOG_EDITOR;
|
||||
correspondentRoleToCheck = RolesIntoOrganization.EDITOR;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue