diff --git a/ecms-social-integration/src/main/java/org/exoplatform/wcm/ext/component/document/service/ShareDocumentService.java b/ecms-social-integration/src/main/java/org/exoplatform/wcm/ext/component/document/service/ShareDocumentService.java index 6e03876d0bd..937bd0d6c61 100644 --- a/ecms-social-integration/src/main/java/org/exoplatform/wcm/ext/component/document/service/ShareDocumentService.java +++ b/ecms-social-integration/src/main/java/org/exoplatform/wcm/ext/component/document/service/ShareDocumentService.java @@ -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 @@ -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 originalActivityTemplateParams = activityManager.getActivity(originalActivityId).getTemplateParams(); String[] originalActivityFilesWorkspaces = getParameterValues(originalActivityTemplateParams, WORKSPACE); if (originalActivityFilesWorkspaces == null) {