-
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: Automation
Steps to reproduce :
- contribute a contribution to check the permission during the download
<extension target="org.nuxeo.ecm.core.io.download.DownloadService" point="permissions"> <permission name="Read"> <script language="JavaScript"> function run() { print("----------------- Start check permissions for DownloadService -----------------"); print("reason " + Reason); print("rendition " + Rendition); print("doc " + (Document == null ? "null" : Document.getId())); print("filename " + (Blob == null ? "null" : Blob.getFilename())); print("xpath " + XPath); var userName = null; if (CurrentUser != null) { // CurrentUser can be null during the BulkAction userName = CurrentUser.getName(); print("user " + userName); } return true; } </script> </permission> </extension>
- Navigate to a workspace
- Select the action "Download All as ZIP"
- Observe the following traces in the logs
----------------- Start check permissions for DownloadService ----------------- reason download rendition null doc eb4b4df8-706c-49aa-868d-e4a45bb538a1 filename CPP.zip xpath null
=> the current user is not displayed, which means that it's missing to evaluate the permissions when downloading in this case
Expected behavior: it should be possible to check the current principal in any case
The problem is related to the way AsyncOperationAdapter starts a new thread to do the asynchronous (bulk) download.