Massimiliano Assante 6 years ago
parent 90c34bb49a
commit 446b3b7d82

@ -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.");
}

Loading…
Cancel
Save