From 707659a99490fe3318352d60374a0d8b607500e1 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Fri, 31 Jan 2020 11:37:59 +0100 Subject: [PATCH] removed the sync of user roles on auth as it was an issue with sobigdata automatic adding of users to VRE --- .../portal/plugins/GCubeHookSiteRoleLocalService.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/portal/plugins/GCubeHookSiteRoleLocalService.java b/src/main/java/org/gcube/portal/plugins/GCubeHookSiteRoleLocalService.java index ae7c864..7d88099 100644 --- a/src/main/java/org/gcube/portal/plugins/GCubeHookSiteRoleLocalService.java +++ b/src/main/java/org/gcube/portal/plugins/GCubeHookSiteRoleLocalService.java @@ -11,14 +11,10 @@ import org.gcube.common.scope.api.ScopeProvider; import org.gcube.common.storagehub.client.dsl.StorageHubClient; import org.gcube.common.storagehub.client.dsl.Util; import org.gcube.common.storagehub.client.dsl.VREFolderManager; -import org.gcube.portal.plugins.util.HookConstants; import org.gcube.vomanagement.usermanagement.GroupManager; -import org.gcube.vomanagement.usermanagement.RoleManager; 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.GCubeRole; -import org.gcube.vomanagement.usermanagement.model.GCubeUser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -58,9 +54,10 @@ public class GCubeHookSiteRoleLocalService extends UserGroupRoleLocalServiceWrap try { String context = gm.getInfrastructureScope(groupId); String username = UserLocalServiceUtil.getUser(userId).getScreenName(); - String userToken = authorizationService().resolveTokenByUserAndContext(username, context); - List userRoles = getUserRoles(roleIds); - authorizationService().setTokenRoles(userToken, userRoles); + /* Commenting this part as when the user is just created it fails*/ +// String userToken = authorizationService().resolveTokenByUserAndContext(username, context); +// List userRoles = getUserRoles(roleIds); +// authorizationService().setTokenRoles(userToken, userRoles); _log.debug("Check if addUserGroupRoles is done in a VRE"); if (gm.isVRE(groupId)) { _log.debug("addUserGroupRoles performed in a VRE, groupId=" + groupId);