I have a code that looks like this:
var creator = document.properties["cm:creator"];
document.setInheritsPermissions(false);
document.removePermission("FullControl","GROUP_SEKRETARIAT");
document.setPermission("Read",creator);
document.setPermission("Write",creator);
document.setPermission("Delete",creator);
document.setOwner("admin");
This rule is executed after user Contributor uploads a content.I'd expect that the creator can Read, Write and Delete the content, and at the same time, admin has full control on the content, but it seems like all the codes set before setOwner is ignored.I've tried to move the setOwner code after setInheritsPermission(false), but that gives me permission error.Did I wrote my code in a wrong way?Thank you in advance!