Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-8949

PrincipalRestrictionProvider.writeRestrictions does not filter rep:nodePath restriction

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.20.0
    • Fix Version/s: 1.26.0
    • Component/s: core, security
    • Labels:
      None

      Description

      org.apache.jackrabbit.oak.security.authorization.restriction.PrincipalRestrictionProvider#writeRestrictions sems too contain useless code right here:

      https://github.com/apache/jackrabbit-oak/blob/e1ababdc2db085a3e73413382262e8adcec716f3/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/restriction/PrincipalRestrictionProvider.java#L100

      The restrictions set is copied to a new HashSet and then some elements are removed from the new set. After that, the new set seems to be never used again.

      The change was introduced by OAK-7944. Before that, the elements were removed from the restrictions set itself and not from the copy.

      Update:

      OAK-7944 only changed the Iteration-Logic, the creation of the new, temporary set was acutally introduced in OAK-758: https://github.com/apache/jackrabbit-oak/commit/645533f1db898b2e9332385cf50ee3feae0da5ce#diff-45fef5680c5074709fba3b2187330e60R86

        Attachments

          Activity

            People

            • Assignee:
              angela Angela Schreiber
              Reporter:
              larsgrefer Lars Grefer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: