Let’s assume that for an unprivileged user you want to grant and revoke read permission on attached workflow documents.
Suppose you want to update the standard Review and Approve (one or more users) workflow to change permissions of attached workflow documents. Extract the parallel-review.bpmn20.xml workflow definition file from <ALF_HOME>/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-5.2.1.jar file and copy it to <ALF_HOME>/tomcat/shared/classes/alfresco/extension/workflow directory.
Modify the parallel-review.bpmn20.xml file to update the <userTask> element. Within the <userTask> element, use the Activiti taskListener “assignment" event to grant the read permission and the Activiti taskListener “delete” event to revoke the read permission.
Log in to the Alfresco Workflow Console as an admin user and deploy the updated workflow definition file by typing the following into the Command field:
deploy activiti alfresco/extension/workflow/parallel-review.bpmn20.xml
Test the updated workflow to ensure that the grant and revoke read permission on attached workflow documents is working properly.