I have a document that goes through various reviews and then when the final review is approved I want to set the permisions of the document to read-only. I have the rule calling my javascript code and it works for administrators but does not work for normal (non-admin) users. Normal users when the rule runs I see this error in the log:
Access Denied. You do not have the appropriate permissions to perform this operation.
Is there a way for a nomal user to be able to set the permissions of the document to read-only
or in the script give them elevated privlidges temporarlity to set the permisions.
This is my code fragment:
//
// Set the Permission we want
// Alfrseco Admins Delete
// Everyone Read-Only
//
document.setPermission("Delete", "GROUP_ALFRESCO_ADMINISTRATORS");
document.setPermission("Read", "GROUP_EVERYONE");
//
// Stop inherting permissions
//
document.setInheritsPermissions(false);
Thank You