Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-11245

AclUtil.removePolicies(Session, List<String> paths) will fail if no policy exists

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Repoinit JCR 1.1.38
    • Repoinit JCR 1.1.40
    • Repoinit
    • None

    Description

      while using

      "delete ACL on /some/path"
      

      i noticed that it will fail if there is no policy to remove.

      the reason for this is the usage of

      AccessControlUtils.getAccessControlList(session, jcrPath);
      

      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

      getAccessControlList(@NotNull JackrabbitAccessControlManager acMgr, 
                                           @Nullable String path, boolean includeApplicable)
      

      that does not retrieve applicable policies in case of 'includeApplicable' is false.

      Attachments

        Activity

          People

            angela Angela Schreiber
            angela Angela Schreiber
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2.5h
                2.5h