[ 
https://issues.apache.org/jira/browse/SLING-11245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17516817#comment-17516817
 ] 

Angela Schreiber commented on SLING-11245:
------------------------------------------

in order to avoid unnecessary failure i would in addition make sure the given 
JCR path is valid for {{AccessControlManager.getPolicies}} similar to the way 
removal of individual ACEs are handled.

> 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
>
>
> 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)

Reply via email to