-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Cannot Reproduce
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Automation, Core
-
Tags:
-
Team:PLATFORM
-
Sprint:nxplatform #43
-
Story Points:2
I encountered this behaviour when trying to empty trashed documents in Web UI (using a non-administrator user with the Everything permission).
Reproduction steps:
- Using Administrator:
- Create a Workspace document ws.
- Create two File documents inside it: f1 & f2.
- Create a user User (no need to add to any group).
- In the permissions view for ws, define a new local permission to permanently grant the Manage everything permission to User (no need to send an email).
- Using User:
- Access ws.
- Select both files and delete them.
- Switch to trash view -> the two documents will be there.
- Click Empty Trash -> both documents should be permanently deleted, but nothing happens.
When Administrator (or any other user from the Administrators Group) clicks Empty Trash, both documents are permanently deleted.
This can also be observed with curl requests:
- Check on the permissions for ws:
curl -u Administrator:Administrator 'http://localhost:8080/nuxeo/api/v1/id/1de9fd2f-30da-48c9-8943-2b8afc80aa3d' \ -H 'enrichers-document: acls'
{ ... "contextParameters": { "acls": [ { "name":"local", "aces":[ { "id":"User:Everything:true:Administrator::", "username":"User", "externalUser":false, "permission":"Everything", "granted":true, "creator":"Administrator", "begin":null, "end":null, "status":"effective" } ] }, ... ] } }
- Check the number of trashed documents for User (should be 2)
curl -u User:User 'http://localhost:8080/nuxeo/api/v1/search/pp/advanced_document_content/execute?ecm_parentId=1de9fd2f-30da-48c9-8943-2b8afc80aa3d&ecm_trashed=true'
{ ... "resultsCount":2 ... }
- Execute the EmptyTrash operation as User
curl -u User:User -i 'http://localhost:8080/nuxeo/api/v1/automation/Document.EmptyTrash' \ -H 'Content-Type: application/json' \ --data-binary '{"params":{"parent":"1de9fd2f-30da-48c9-8943-2b8afc80aa3d"},"context":{}}'
HTTP/1.1 204
- Recheck the number of trashed documents for User (should be 0, but it's still 2)
curl -u User:User 'http://localhost:8080/nuxeo/api/v1/search/pp/advanced_document_content/execute?ecm_parentId=1de9fd2f-30da-48c9-8943-2b8afc80aa3d&ecm_trashed=true'
{ ... "resultsCount":2 ... }
- Check the number of trashed documents for Administrator (should be 2)
curl -u Administrator:Administrator 'http://localhost:8080/nuxeo/api/v1/search/pp/advanced_document_content/execute?ecm_parentId=1de9fd2f-30da-48c9-8943-2b8afc80aa3d&ecm_trashed=true'
{ ... "resultsCount":2 ... }
- Execute the EmptyTrash operation as Administrator
curl -u Administrator:Administrator -i 'http://localhost:8080/nuxeo/api/v1/automation/Document.EmptyTrash' \ -H 'Content-Type: application/json' \ --data-binary '{"params":{"parent":"1de9fd2f-30da-48c9-8943-2b8afc80aa3d"},"context":{}}'
HTTP/1.1 204
- Recheck the number of trashed documents for Administrator (should be 0)
curl -u Administrator:Administrator 'http://localhost:8080/nuxeo/api/v1/search/pp/advanced_document_content/execute?ecm_parentId=1de9fd2f-30da-48c9-8943-2b8afc80aa3d&ecm_trashed=true'
{ ... "resultsCount":0 ... }