You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Angela Schreiber (Jira)" <ji...@apache.org> on 2022/04/04 15:33:00 UTC

[jira] [Resolved] (SLING-11245) AclUtil.removePolicies(Session, List paths) will fail if no policy exists

     [ https://issues.apache.org/jira/browse/SLING-11245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Angela Schreiber resolved SLING-11245.
--------------------------------------
    Resolution: Fixed

> AclUtil.removePolicies(Session, List<String> paths) will fail if no policy exists
> ---------------------------------------------------------------------------------
>
>                 Key: SLING-11245
>                 URL: https://issues.apache.org/jira/browse/SLING-11245
>             Project: Sling
>          Issue Type: Bug
>          Components: Repoinit
>    Affects Versions: Repoinit JCR 1.1.38
>            Reporter: Angela Schreiber
>            Assignee: Angela Schreiber
>            Priority: Major
>             Fix For: Repoinit JCR 1.1.40
>
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> while using 
> {code}
> "delete ACL on /some/path"
> {code}
> i noticed that it will fail if there is no policy to remove.
> the reason for this is the usage of 
> {code}
> AccessControlUtils.getAccessControlList(session, jcrPath);
> {code}
> which may return an applicable policy if no policy exists yet at the given path.
> however, a new applicable policy cannot be removed.
> note that the other variants to delete a policy are not affected because they only retrieve existing policies.
> in order to fix that usage of  AccessControlUtils.getAccessControlList(session, jcrPath) should be replaced by a local utility method 
> {code}
> getAccessControlList(@NotNull JackrabbitAccessControlManager acMgr, 
>                                      @Nullable String path, boolean includeApplicable)
> {code}
> that does not retrieve applicable policies in case of 'includeApplicable' is false.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)