cancel
Showing results for 
Search instead for 
Did you mean: 

Move document in task

agz
Champ on-the-rise
Champ on-the-rise
Hi all,
in my custom workflow, after the approvation, I need to move the document in a specified folder.

I have a document in a site.
- User A and user B are "Collaborator" of the site.
- User A is owner of the document, start the approvation workflow.
- User B is the approver, when document is approved/rejected by B it should be moved in a folder (via javascript). This is not possible (Exception) because B have not right permissions to move document.

org.alfresco.scripts.ScriptException: 08070088 Failed to execute supplied scrip: Access Denied. You do not have appropriate permissions to perform this operation 

But I need to have that B is a collaborator.
Is there a way to set only the move action for the owner of the document? (in this manner the document will move!).

Or other solution..
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

you need to specify the runAs context of the move action in order to have it run as a different user. In JBPM, the AlfrescoJavaScript class allows the "runas" property to specify the user in whose permission context the action should run. In Activiti you have either ScriptTaskListener or ScriptExecutionListener (depending on the context you attach a script to), which support a "runAs" property (note the case) to do the same.

Regards
Axel

agz
Champ on-the-rise
Champ on-the-rise
Thanks,
I had not seen the "Run as".
I set "admin" and all works!  :wink:

Thanks a lot  😎