From 2e507afbe9c462bbc61b9eecafc948b1e5b93a9f Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Tue, 1 Oct 2024 15:21:45 +0100 Subject: [PATCH] feat: Update calls to UserACL to avoid implicit usage of Conversation State in Service Layer - MEED-7555 - Meeds-io/MIPs#151 (#228) This change will update UserACL usage to not implicitly use the current conversation state of authenticated user. --- .../src/main/webapp/WEB-INF/jsp/spacesListWidget.jsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analytics-webapps/src/main/webapp/WEB-INF/jsp/spacesListWidget.jsp b/analytics-webapps/src/main/webapp/WEB-INF/jsp/spacesListWidget.jsp index c886155f9..37712cc04 100644 --- a/analytics-webapps/src/main/webapp/WEB-INF/jsp/spacesListWidget.jsp +++ b/analytics-webapps/src/main/webapp/WEB-INF/jsp/spacesListWidget.jsp @@ -1,3 +1,4 @@ +<%@page import="org.exoplatform.services.security.ConversationState"%> <% /** * This file is part of the Meeds project (https://meeds.io/). @@ -42,7 +43,7 @@ String spacesMostActivePeriod = request.getAttribute("spacesMostActivePeriod") == null ? "30" : ((String[]) request.getAttribute("spacesMostActivePeriod"))[0]; Page currentPage = PortalRequestContext.getCurrentInstance().getPage(); boolean canEdit = ExoContainerContext.getService(UserACL.class) - .hasEditPermission(currentPage); + .hasEditPermission(currentPage, ConversationState.getCurrent().getIdentity()); String pageRef = currentPage.getPageKey().format(); boolean canCreateSpace = ExoContainerContext.getService(SpacesAdministrationService.class) .canCreateSpace(request.getRemoteUser());