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

Make action context more robust

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Current user is pushed to the context to evaluate rendition and imaging action filters..
    • Backlog priority:
      250
    • Sprint:
      nxsupport 11.1.4, nxsupport 11.1.5

      Description

      Some actions are not correctly filtered because the context is not completely set.

      For example, setting the filter for the PDF rendition will fail is a user or group is tested

      <extension point="filters" target="org.nuxeo.ecm.platform.actions.ActionService">
       <filter append="true" id="allowPDFRendition">
       <rule grant="false">
       <group>administrators</group>
       </rule>
       </filter>
      </extension> 

      because the current principal is not set by the Action Context used to filter the actions:

      RenditionDefinitionRegistry.java
          protected ActionContext createActionContext(DocumentModel doc) {
              ActionContext actionContext = new ELActionContext();
              actionContext.setCurrentDocument(doc);
              actionContext.setDocumentManager(doc.getCoreSession());
              return actionContext;
          } 

      At least, something like below is missing

              actionContext.setCurrentPrincipal(doc.getCoreSession().getPrincipal());
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 10 minutes
                1h 10m

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.