cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, i have a problem in assigning permissions to files

klotilda
Champ on-the-rise
Champ on-the-rise

Hello, I am using a review and approve workflow , but i am facing a problem.When i attach a file on the flow from a folder that the second user doesn't have access,then the second user can not see the attached file.

Can somebody help me, Thanks in advance.

1 ACCEPTED ANSWER

kalpesh_c2
Star Collaborator
Star Collaborator

Hi klotilda n‌,
You are facing this problem because another user may haven't permission to access that file.
So you may have to give the permission on that document to other user refer this Setting user permissions | Alfresco Documentation or if you don't wanted to give permission manually you can use Shared Folder to place your document in this place every user have permission to access the document available in it.

And another option you can create your own custom workflow and in workflow tasks have multiple event listeners are available to you can execute your script code to give the permission on the document if required then remove the permission if worklow get completed.

Thanks,
Kalpesh,

ContCentric

View answer in original post

4 REPLIES 4

kalpesh_c2
Star Collaborator
Star Collaborator

Hi klotilda n‌,
You are facing this problem because another user may haven't permission to access that file.
So you may have to give the permission on that document to other user refer this Setting user permissions | Alfresco Documentation or if you don't wanted to give permission manually you can use Shared Folder to place your document in this place every user have permission to access the document available in it.

And another option you can create your own custom workflow and in workflow tasks have multiple event listeners are available to you can execute your script code to give the permission on the document if required then remove the permission if worklow get completed.

Thanks,
Kalpesh,

ContCentric

Hi Kalpesh, thanks for the reply. I have been trying to create custom workflows to give permission on a file only for the duration of the workflow but haven't achieved it. Could you please help on the event listeners that i can use to give permission on a file only for the workflow. This would be very helpful. 

<activiti:taskListener event="assignment" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
                  <activiti:field name="script">
                     <activiti:string><![CDATA[
                    
                   var documents = bpm_package.children;
                for (var i = 0; i < documents.length; i++) {
                    documents[i].setPermission("Your_Permission",task.assignee);
                   }
                    ]]></activiti:string>
                  </activiti:field>
               </activiti:taskListener>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Use the task listener assignment event or you can use any event listener, you can use script task or service task as well  to execute your script.

Thanks a lot Smiley Happy