cancel
Showing results for 
Search instead for 
Did you mean: 

how to set file readonly after approved

tuanzhang
Champ in-the-making
Champ in-the-making
What I want:

userA create a file in folderA, then approved it to folderB ( copy to folderB ), then userA should not allowed to modify this file in folderB

thanks in advance
2 REPLIES 2

steven_okennedy
Star Contributor
Star Contributor
Hi

How are you managing your approval process?  Is it a simple workflow (e.g. Rules on folders using the Add Simple Workflow action), a complex workflow (designed and implemented in Activiti) or is it just a set of manual steps?

What you need to do is change the permissions on the item once the approval is done, but how you go about doing it will depend on the mechanism you're using to manage the workflow.

E.g. using Activiti, you would use a ServiceTask/ScriptTask or a TaskListener/ExecutionListener once the approval action has been taken to remove the userA's permissions on the file and replace it with Consumer (read-only) permissions (you might need to change the ownership of the document if userA is the user who created it as the Owner always has Full Permissions).

However, if you're using Simple Workflows (http://docs.alfresco.com/5.1/tasks/library-folder-rules-simpleworkflow.html), you would need to handle this work as a custom action that gets fired whenever a document enters folderB, or whenever an item in folderB's status is updated to approved or something along those lines.  You would still modify the permissions/ownership in the same way though.

If you never want the document to change once it's been approved, you could also look at the Records Management module and declare the document as a record instead of messing with permissions - this will mark the document as a record that you'll need to file in the File Plan and it will be become completely non-modifiable by any users(except for some Records Management roles in certain cases)

Regards

Steven

Thank you steven, very useful, I will look at those methods