-
Type: Bug
-
Status: Resolved
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: 2021.0
-
Component/s: Core
-
Release Notes Summary:Documents with sub-documents where permissions are blocked cannot be deleted
-
Release Notes Description:
-
Tags:
-
Backlog priority:900
-
Sprint:nxplatform #87, nxplatform #88
-
Story Points:8
Steps to reproduce:
- create a folder A
- set ReadWrite permission to user Duncan
- in folder A, create 2 documents AA and AB
- block rights inheritance on document AB => Ducan cannot access document AB
- as the user Duncan, delete folder A, with a curl command like below
curl -X DELETE 'https://xxx.nuxeo.com/nuxeo/api/v1/id/837faafd-7505-432c-92ea-53ada7f1c078?' -H 'Nuxeo-Transaction-Timeout: 3000' -H 'X-NXproperties: *' -H 'X-NXRepository: default' -H 'content-type: application/json' -u Administrator:Administrator
Observe that folder A and documents AA and AB are definitively deleted whereas document AB should not be deleted
Expected behavior: at least 3 ways of dealing with that:
1) folder A and document AA are deleted because Duncan has ReadWrite permission them ; document AB is not deleted but becomes a placeless document
2) only document AA is deleted ; document AB is not deleted because Duncan cannot delete it and folder A is kept to be able to browse to document AB ==> this last solution seems to be the most common one as for example on a Linux system, the folders are not deleted if a children cannot be deleted (but Nuxeo is different and documents can be placeless, so I will not force to this solution)
3) nothing is performed as there is a document which cannot be deleted and a warning is displayed to the user or returned in the response
The current behavior is related to the fact that the deletion is delegated to the backend and some kind of DELETE ON CASCADE is operated without checking the permissions.
There could be a pre-check before performing the delete to find all the documents which cannot be deleted, and then delete the correct documents from the leaf to the root thanks to the BAF.