cancel
Showing results for 
Search instead for 
Did you mean: 

Owner permission removal... How?

meansartin14
Champ in-the-making
Champ in-the-making
I need to, simply, remove the ability to edit and delete a content item from its owner once it has been copied into a folder.

I used this thread to run a simple JavaScript on a new content item when it is added to the folder. This JavaScript contains the following two lines only:


document.setPermissions("Consumer", "GROUP_EVERYONE");
document.setInheritsPermissions(false);

However, I receive an error that 'setPermissions' can not be found.

Any ideas/suggestions? What am I doing wrong? Is there a list of the available JavaScript functions? Is there a better way to do what I want to do?
3 REPLIES 3

vinaxwater
Champ in-the-making
Champ in-the-making
The method is wrong. This is code working for me:

var resource = bpm_package.children[j];
resource.setPermission("Coordinator", user.properties.userName);

meansartin14
Champ in-the-making
Champ in-the-making
OK, so here's what I've tried:

remove_perms.js
document.setPermission("Consumer", "GROUP_EVERYONE");
document.setInheritsPermissions(false);

permissionDefinitions.xml

<!– For now, owners can always see, find and manipulate their stuff     –>
[b]<!–[/b] <globalPermission permission="FullControl" authority="ROLE_OWNER"/> [b]–>[/b]

I then created a rule that, for any content added to an area, executes the remove_perms.js script above.

I receive the following error from Alfresco when adding content:
A system error happened during the operation: Failed to execute script 'workspace://SpacesStore/1b68fcea-af12-45db-8bd8-2a9f54f8b3a2': Failed to execute script 'workspace://SpacesStore/1b68fcea-af12-45db-8bd8-2a9f54f8b3a2': Wrapped org.alfresco.repo.security.permissions.AccessDeniedException: Access Denied. You do not have the appropriate permissions to perform this operation. (AlfrescoScript#1)

vinaxwater
Champ in-the-making
Champ in-the-making
OK! You haven't permission for Invite user into resource. Try with permission "Coordinator" instead of "Consumer".
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.