-
Type: Improvement
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Component/s: Translations
-
Tags:
-
Backlog priority:700
-
Sprint:nxK-2020-5, nxK-2020-7, nxK-2020-8
I ran into this in the following scenario, in Automation:
- In the event handler for "Empty Document Created"
- Copy the schema from another document (Document.CopySchema)
- This schema contains a field of type Document, with a valid document ID inside
- However the user creating the document doesn't have read access to the referenced document
Nuxeo throws "Caused by: org.nuxeo.ecm.core.api.validation.DocumentValidationException: Constraint violation thrown: '"default:aa6ce7d..." is not a valid document id.'" This is technically wrong, the document ID is valid. It's difficult to troubleshoot because it's not a permission error and led me to try troubleshooting the ID itself (e.g. I tried adding the prefix "default:" to see if that's why the validation failed).
The improvement: when validating a document ID, if the user doesn't have access to the document, return a permission error instead.