mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ACS-3364 Add permission handling to linkedToBy. (#1425)
This commit is contained in:
@@ -30,7 +30,6 @@ import static org.alfresco.rest.api.model.rules.InclusionType.LINKED;
|
||||
import static org.alfresco.rest.api.model.rules.InclusionType.OWNED;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.rest.api.model.rules.RuleSet;
|
||||
@@ -93,12 +92,7 @@ public class RuleSetLoader
|
||||
}
|
||||
if (includes.contains(LINKED_TO_BY))
|
||||
{
|
||||
List<NodeRef> linkedToBy = nodeService.getParentAssocs(ruleSetNodeRef)
|
||||
.stream()
|
||||
.map(ChildAssociationRef::getParentRef)
|
||||
.filter(folder -> !folder.equals(parentRef))
|
||||
.collect(Collectors.toList());
|
||||
ruleSet.setLinkedToBy(linkedToBy);
|
||||
ruleSet.setLinkedToBy(loadLinkedToBy(ruleSetNodeRef));
|
||||
}
|
||||
if (includes.contains(IS_INHERITED))
|
||||
{
|
||||
@@ -113,6 +107,11 @@ public class RuleSetLoader
|
||||
return ruleService.getFoldersInheritingRuleSet(ruleSetNodeRef, MAX_INHERITED_BY_SIZE);
|
||||
}
|
||||
|
||||
private List<NodeRef> loadLinkedToBy(NodeRef ruleSetNodeRef)
|
||||
{
|
||||
return ruleService.getFoldersLinkingToRuleSet(ruleSetNodeRef);
|
||||
}
|
||||
|
||||
private boolean loadIsInherited(NodeRef ruleSetNodeRef)
|
||||
{
|
||||
return AuthenticationUtil.runAsSystem(() -> !ruleService.getFoldersInheritingRuleSet(ruleSetNodeRef, 1).isEmpty());
|
||||
|
Reference in New Issue
Block a user