Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24338

Fix hasEntry method with MongoDB directories

    XMLWordPrintable

    Details

    • Release Notes Summary:
      The hasEntry method works correctly with MongoDB directories.
    • Backlog priority:
      900
    • Sprint:
      nxcore 10.1.4
    • Story Points:
      2

      Description

      hasEntry method does not work on directories whose schema is not vocabulary. The problem is visible in the use of aceinfo directory by nuxeo-permissions

      The call to hasEntry in this method

      PermissionListener.java
                          for (ACE ace : diff.addedACEs) {
                              String id = computeDirectoryId(doc, diff.aclName, ace.getId());
                              // remove it if it exists
                              if (session.hasEntry(id)) {
      

      produces the following MongoDB query

      COMMAND [conn242] command nuxeosb.aceinfo command: count { count: "aceinfo", query: { id: "d85faef6-f4d1-4c40-bea8-001e62b09ca4:default:local:ACA-HO:Read:true::1483272000000:1546344000000" } } planSummary: COLLSCAN keysExamined:0 docsExamined:119450 numYields:933 reslen:44 locks:{ Global: { acquireCount: { r: 1868 } }, Database: { acquireCount: { r: 934 } }, Collection: { acquireCount: { r: 934 } } } protocol:op_query 106ms
      

      which returns no result.

      Instead of using id, the query should use aceinfo:id where we can see that a query like

      MongoDB Enterprise aca-sandbox:PRIMARY> db.aceinfo.find({ "aceinfo:id": "d85faef6-f4d1-4c40-bea8-001e62b09ca4:default:local:ACA-HO:Read:true::1483272000000:1546344000000" }).count() RETURNS 1
      

      returns a non-zero result

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour
                1d 1h