removed the sync of user roles on auth as it was an issue with sobigdata

automatic adding of users to VRE
This commit is contained in:
Massimiliano Assante 2020-01-31 11:37:59 +01:00
parent 978bde8610
commit 707659a994
1 changed files with 4 additions and 7 deletions

View File

@ -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<String> 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<String> 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);