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

OR-CompositeTreePermission.grantsPermission should loop over aggregates of supported permissions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.14.0
    • core, security
    • None

    Description

      stillalex, issue as discussed in person: while working on OAK-8269 and the missing tests for the ORing CompositeTreePermission i noticed the following issue in grantsPermission: after obtaining the supported permissions the code loops over the individual permissions aggregated. but passes the original permission instead of the supported ones which potentially only include a subset.

      the affected code inside the method looks as follows:

                  long supported = providers[i].supportedPermissions(tp, property, permissions);
                  if (doEvaluate(supported)) {
                      if (compositionType == AND) {
                         [...]
                      } else {
                          for (long p : Permissions.aggregates(permissions)) {    // <==== issue line 221 
                              [...]
                          }
                      }
                  }
      

      IMO the code at line 221 should rather be as follows:

      for (long p : Permissions.aggregates(supported)) {
      

      i will go ahead fix it along with a test case that illustrates the issue.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: