From f3c8f396c0b018a78c496da6e5ecbd77a2a37811 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Tue, 1 Oct 2024 13:27:24 +0100 Subject: [PATCH] feat: Update calls to UserACL to avoid implicit usage of ConversationState in Service Layer - MEED-7555 - Meeds-io/MIPs#151 (#658) This change will update `UserACL` usage to not implicitly use the current conversation state of authenticated user in `UserACL` (ServiceLayer). --- .../commons/info/PlatformInformationRESTService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commons-component-product/src/main/java/org/exoplatform/commons/info/PlatformInformationRESTService.java b/commons-component-product/src/main/java/org/exoplatform/commons/info/PlatformInformationRESTService.java index fd818d269f..18a7eefeb7 100644 --- a/commons-component-product/src/main/java/org/exoplatform/commons/info/PlatformInformationRESTService.java +++ b/commons-component-product/src/main/java/org/exoplatform/commons/info/PlatformInformationRESTService.java @@ -30,6 +30,7 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.rest.resource.ResourceContainer; +import org.exoplatform.services.security.ConversationState; /** * @author Anouar @@ -72,7 +73,7 @@ public Response getPlatformInformation() { String plfProfile = ExoContainer.getProfiles().toString().trim(); String runningProfile = plfProfile.substring(1, plfProfile.length() - 1); JsonPlatformInfo jsonPlatformInfo = new JsonPlatformInfo(); - if (userACL.isUserInGroup(userACL.getAdminGroups())) { + if (userACL.isAdministrator(ConversationState.getCurrent().getIdentity())) { jsonPlatformInfo.setPlatformVersion(platformInformations.getVersion()); jsonPlatformInfo.setPlatformBuildNumber(platformInformations.getBuildNumber()); jsonPlatformInfo.setPlatformRevision(platformInformations.getRevision());