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

Fix ACLS enricher on document property

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.10-HF54
    • Fix Version/s: 10.10-HF59, 2021.17
    • Component/s: Core IO
    • Release Notes Summary:
      ACLs are now accessible on fully loaded detached documents
    • Backlog priority:
      900
    • Sprint:
      nxplatform #55, nxplatform #56
    • Story Points:
      5

      Description

      Steps to reproduce:

      1. define a document type where one of its metadata is a Document property
      2. deploy the project with this document type definition, for example NXP-30846.jar
      3. create a document of this type and set the Document property to an existing document
      4. at this step, the JSON export of the document would look like
        {
          "entity-type": "document",
          "repository": "default",
          "uid": "e4ead11a-59a5-418d-ae66-e614f1b12614",
          "path": "/default-domain/UserWorkspaces/Administrator/deliv",
          "type": "Delivery",
        ..
          "properties": {
            "delivery:docu": "1aa36175-fcba-4d53-8555-fd59ae000d6d",
        ...
          }
        }
        
      1. run this curl command
        curl -u Administrator:Administrator 'http://localhost:8080/nuxeo/api/v1/path/default-domain/UserWorkspaces/Administrator/deliv' \
          -H 'depth: max' \
          -H 'fetch.document: delivery:docu' \
          -H 'enrichers-document: acls' \
          -H 'Content-Type: application/json' \
          -H 'accept: text/plain,application/json, application/json' \
          -H 'properties: *' |json_pp
        

      Observed behavior:
      It will generate a warning in the logs for the uuid referenced by the Document property

      WARN  [AbstractJsonEnricher] The following error occured with enricher: acls
      org.nuxeo.ecm.core.api.NuxeoException: The DocumentModel is not associated to an open CoreSession: DocumentModelImpl(1aa36175-fcba-4d53-8555-fd59ae000d6d, path=/default-domain/sections, title=Sections)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getSession(DocumentModelImpl.java:366) ~[nuxeo-core-api-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getACP(DocumentModelImpl.java:759) ~[nuxeo-core-api-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.permissions.ACLJsonEnricher.write(ACLJsonEnricher.java:127) ~[nuxeo-permissions-10.10-HF14.jar:?]
      	at org.nuxeo.ecm.permissions.ACLJsonEnricher.write(ACLJsonEnricher.java:108) ~[nuxeo-permissions-10.10-HF14.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:70) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher.write(AbstractJsonEnricher.java:46) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter.write(ExtensibleEntityJsonWriter.java:100) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.writeEntity(AbstractJsonWriter.java:144) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.fetchProperty(DocumentPropertyJsonWriter.java:174) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.writeScalarProperty(DocumentPropertyJsonWriter.java:126) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.writeProperty(DocumentPropertyJsonWriter.java:111) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.write(DocumentPropertyJsonWriter.java:105) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertyJsonWriter.write(DocumentPropertyJsonWriter.java:91) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonWriter.writeSchemaProperties(DocumentModelJsonWriter.java:267) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonWriter.doWriteEntityBody(DocumentModelJsonWriter.java:212) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonWriter.lambda$writeEntityBody$0(DocumentModelJsonWriter.java:154) ~[nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonWriter.withDocumentAttached(DocumentModelJsonWriter.java:283) [nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonWriter.writeEntityBody(DocumentModelJsonWriter.java:154) [nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonWriter.writeEntityBody(DocumentModelJsonWriter.java:117) [nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter.write(ExtensibleEntityJsonWriter.java:80) [nuxeo-core-io-10.10-HF57.jar:?]
      	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter.write(AbstractJsonWriter.java:81) [nuxeo-core-io-10.10-HF57.jar:?]
      

       and the JSON result will be missing the "acls" context properties for the Document property.

      Expected behavior:
      No warn is generated.
      The JSON includes the acls for the Document property

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: