AnsweredAssumed Answered

remove Edit through removePermission()

Question asked by e-no91 on May 30, 2014
Latest reply on Jun 4, 2014 by e-no91
User B is set as contributor and uploads a document, I have set this script to fire if document is added to folder:


var creator = document.properties["cm:creator"];


document.setInheritsPermissions(false);
document.setPermission("Collaborator",creator);
document.removeAspect("fm:discussion");
document.removePermission("Delete",creator);
document.removePermission("Editor",creator);
document.removePermission("Write",creator);
document.removePermission("AddChildren",creator);
document.setInheritsPermissions(true);
document.setOwner("GROUP_ALFRESCO_ADMINISTRATORS");




But after passing through this code, User B is still able to Edit the file.
If I change

document.setPermission("Collaborator",creator);


to

document.setPermission("Contributor",creator);

or

document.setPermission("Consumer",creator);


the Edit permission can be removed through

document.removePermission("Write",creator);


I set User B as Collaborator because I want the user to be able to click the Share button.
How do I remove the Edit permission for Collaborator??

Outcomes