-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 8.10
-
Component/s: Core MongoDB, Directory
-
Release Notes Summary:The hasEntry method works correctly with MongoDB directories.
-
Tags:
-
Backlog priority:900
-
Sprint:nxcore 10.1.4
-
Story Points:2
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