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

Validation returns "is not a valid document id" if user cannot access document

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.10
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Translations
    • Tags:
    • Backlog priority:
      700
    • Sprint:
      nxK-2020-5, nxK-2020-7, nxK-2020-8

      Description

      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.
       

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: