-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 10.10
-
Fix Version/s: 10.10-HF15, 11.1, 2021.0
-
Component/s: Actions & Filters, Renditions
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());