From ff6cd1f69c057ead32bcdbc826c91ab0013ac7af Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Tue, 6 Apr 2021 12:51:25 +0200 Subject: [PATCH] none --- .../portlets/user/wswidget/StorageHubServiceUtil.java | 5 ++--- src/main/webapp/html/workspacewidget/view.jsp | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/wswidget/StorageHubServiceUtil.java b/src/main/java/org/gcube/portlets/user/wswidget/StorageHubServiceUtil.java index 864c9df..531e0a0 100644 --- a/src/main/java/org/gcube/portlets/user/wswidget/StorageHubServiceUtil.java +++ b/src/main/java/org/gcube/portlets/user/wswidget/StorageHubServiceUtil.java @@ -157,11 +157,10 @@ public class StorageHubServiceUtil { * @param request * @return the VRE Folders Id */ - public static String getVREFoldersId(long groupId, HttpServletRequest request) { + public static String getVREFoldersId(long groupId, HttpServletRequest request, String currentUsername) { String toReturn = ""; - PortalContext pContext = PortalContext.getConfiguration(); String currentContext = PortalContext.getConfiguration().getCurrentScope(""+groupId); - String username = pContext.getCurrentUser(request).getUsername(); + String username = currentUsername; try { JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, username, currentContext); UmaJWTProvider.instance.set(umaToken.getRaw()); diff --git a/src/main/webapp/html/workspacewidget/view.jsp b/src/main/webapp/html/workspacewidget/view.jsp index 67e3231..21ba5b1 100644 --- a/src/main/webapp/html/workspacewidget/view.jsp +++ b/src/main/webapp/html/workspacewidget/view.jsp @@ -3,7 +3,10 @@ -<% pageContext.setAttribute("currentGroup", GroupLocalServiceUtil.getGroup(PortalUtil.getScopeGroupId(request))); +<% +pageContext.setAttribute("currentGroup", GroupLocalServiceUtil.getGroup(PortalUtil.getScopeGroupId(request))); +pageContext.setAttribute("currentUsername", PortalUtil.getUser(request).getScreenName()); +; %> @@ -42,7 +45,7 @@ - <%pageContext.setAttribute("vreFoldersId", StorageHubServiceUtil.getVREFoldersId(PortalUtil.getScopeGroupId(request), request));%> + <%pageContext.setAttribute("vreFoldersId", StorageHubServiceUtil.getVREFoldersId(PortalUtil.getScopeGroupId(request), request, currentUsername));%>