Skip to content

Commit

Permalink
fix: Fix Space Service API usage for Space Read Permission Check - ME…
Browse files Browse the repository at this point in the history
…ED-7524 - Meeds-io/MIPs#147 (#2402)

This change will adapt the Space based operation (`shareDocumentActivityToSpace`) to use the ACL check algorithm from `SpaceService` instead of redefining it.
  • Loading branch information
boubaker authored Sep 26, 2024
1 parent 428f065 commit 0c4f6b0
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import org.exoplatform.wcm.ext.component.activity.FileUIActivity;
import org.exoplatform.wcm.ext.component.activity.listener.Utils;


/**
* Created by The eXo Platform SAS
* Author : eXoPlatform
Expand Down Expand Up @@ -320,11 +319,9 @@ public void shareDocumentActivityToSpace(ExoSocialActivity sharedActivity) throw
String originalActivityId = sharedActivity.getTemplateParams().get("originalActivityId");
String spacePrettyName = sharedActivity.getActivityStream().getPrettyId();
Space targetSpace = spaceService.getSpaceByPrettyName(spacePrettyName);
Identity targetSpaceIdentity = identityManager.getOrCreateSpaceIdentity(spacePrettyName);
Identity posterIdentity = identityManager.getIdentity(sharedActivity.getPosterId());
String posterUsername = posterIdentity.getRemoteId();
if (targetSpaceIdentity != null && SpaceUtils.isSpaceManagerOrSuperManager(posterUsername, targetSpace.getGroupId())
|| (spaceService.isMember(targetSpace, posterUsername) && SpaceUtils.isRedactor(posterUsername, targetSpace.getGroupId()))) {
if (spaceService.canRedactOnSpace(targetSpace, posterUsername)) {
Map<String, String> originalActivityTemplateParams = activityManager.getActivity(originalActivityId).getTemplateParams();
String[] originalActivityFilesWorkspaces = getParameterValues(originalActivityTemplateParams, WORKSPACE);
if (originalActivityFilesWorkspaces == null) {
Expand Down

0 comments on commit 0c4f6b0

Please sign in to comment.