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

Fix NPE in ReadVersion permission replacement

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2021.0
    • Fix Version/s: 2021.16
    • Component/s: Core, Security / Rights

      Description

      Since NXP-28370, the property "org.nuxeo.version.readversion.disabled" controls (indirectly) if the permission ReadVersion is turned into Read.

      It may cause a NPE if there are some inconsistencies in the database :

      Caused by: java.lang.NullPointerException
      	at org.nuxeo.ecm.core.api.security.impl.ACLImpl.replacePermission(ACLImpl.java:199) ~[nuxeo-core-api-2021.4.16.jar:?]
      	at org.nuxeo.ecm.core.api.security.impl.ACPImpl.lambda$replacePermission$1(ACPImpl.java:472) ~[nuxeo-core-api-2021.4.16.jar:?]
      	at java.util.ArrayList.forEach(ArrayList.java:1541) ~[?:?]
      	at org.nuxeo.ecm.core.api.security.impl.ACPImpl.replacePermission(ACPImpl.java:472) ~[nuxeo-core-api-2021.4.16.jar:?]
      	at org.nuxeo.ecm.core.model.BaseSession.getACP(BaseSession.java:164) ~[nuxeo-core-2021.4.16.jar:?]
      	at org.nuxeo.ecm.core.model.BaseSession.getMergedACP(BaseSession.java:182) ~[nuxeo-core-2021.4.16.jar:?]
      	at org.nuxeo.ecm.core.api.AbstractSession.getACP(AbstractSession.java:601) ~[nuxeo-core-2021.4.16.jar:?]
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getACP(DocumentModelImpl.java:784) ~[nuxeo-core-api-2021.4.16.jar:?]
      	at org.nuxeo.elasticsearch.io.JsonESDocumentWriter.writeSystemProperties(JsonESDocumentWriter.java:132) ~[nuxeo-elasticsearch-core-2021.4.16-SUPNXP-37612-2.jar:?]
      	at org.nuxeo.elasticsearch.io.JsonESDocumentWriter.writeESDocument(JsonESDocumentWriter.java:195) ~[nuxeo-elasticsearch-core-2021.4.16-SUPNXP-37612-2.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.source(ElasticSearchIndexingImpl.java:432) ~[nuxeo-elasticsearch-core-2021.4.16-SUPNXP-37612-2.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.buildEsIndexingRequest(ElasticSearchIndexingImpl.java:414) ~[nuxeo-elasticsearch-core-2021.4.16-SUPNXP-37612-2.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.processBulkIndexCommands(ElasticSearchIndexingImpl.java:178) ~[nuxeo-elasticsearch-core-2021.4.16-SUPNXP-37612-2.jar:?]
      	at org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl.indexNonRecursive(ElasticSearchIndexingImpl.java:147) ~[nuxeo-elasticsearch-core-2021.4.16-SUPNXP-37612-2.jar:?]
      	at org.nuxeo.elasticsearch.ElasticSearchComponent.indexNonRecursive(ElasticSearchComponent.java:419) ~[nuxeo-elasticsearch-core-2021.4.16-SUPNXP-37612-2.jar:?]
      	at org.nuxeo.elasticsearch.work.BucketIndexingWorker.doWork(BucketIndexingWorker.java:79) ~[nuxeo-elasticsearch-core-2021.4.16-SUPNXP-37612-2.jar:?]
      	at org.nuxeo.elasticsearch.work.BaseIndexingWorker.work(BaseIndexingWorker.java:48) ~[nuxeo-elasticsearch-core-2021.4.16-SUPNXP-37612-2.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:533) ~[nuxeo-core-event-2021.2.52.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:385) ~[nuxeo-core-event-2021.2.52.jar:?]
      	... 4 more
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: