From 446b3b7d8215a62da8a475e3f5783cbd574f5717 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Thu, 21 Jun 2018 15:20:06 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/sbd-uploadshare-portlet@169391 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../portlets/user/vremanagement/RequestVRE.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/vremanagement/RequestVRE.java b/src/main/java/org/gcube/portlets/user/vremanagement/RequestVRE.java index 0cce982..b59bbfe 100644 --- a/src/main/java/org/gcube/portlets/user/vremanagement/RequestVRE.java +++ b/src/main/java/org/gcube/portlets/user/vremanagement/RequestVRE.java @@ -37,6 +37,7 @@ import org.gcube.common.scope.api.ScopeProvider; import org.gcube.portal.notifications.bean.GenericItemBean; import org.gcube.portal.notifications.thread.MessageNotificationsThread; import org.gcube.vomanagement.usermanagement.exception.RoleRetrievalFault; +import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager; import org.gcube.vomanagement.usermanagement.impl.LiferayRoleManager; import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager; import org.gcube.vomanagement.usermanagement.model.GCubeUser; @@ -100,18 +101,17 @@ public class RequestVRE extends MVCPortlet { long infraManagerRoleId = -1; boolean result = false; if (theManagers == null || theManagers.isEmpty()) { - + String rootVoName = PortalContext.getConfiguration().getInfrastructureName(); + long therootGroupId = new LiferayGroupManager().getGroupIdFromInfrastructureScope("/"+rootVoName); try { - infraManagerRoleId = roleManager.getRoleIdByName("Administrator"); + infraManagerRoleId = roleManager.getRoleIdByName(GatewayRolesNames.INFRASTRUCTURE_MANAGER.getRoleName()); + theManagers = userManager.listUsersByGroupAndRole(therootGroupId, infraManagerRoleId); } catch (RoleRetrievalFault e) { - _log.warn("There is no (Site) Role " + infraManagerRoleId + " in this portal. Will not notify about this vre request"); + _log.warn("There are no users with (Site) Role " + infraManagerRoleId + " on " + rootVoName + " in this portal. Will not notify about this vre request"); return; } - theManagers = userManager.listUsersByGlobalRole(infraManagerRoleId); - } - if (theManagers == null || theManagers.isEmpty()) { _log.warn("There are no users with (Site) Role " + infraManagerRoleId + " on this portal. Will not notify about this vre request."); }