0
votes

I have an alfresco folder (PARENT_FOLDER) with more than 300 subfolder, and I want to grant consumer role to certain group (GROUP1) and certain subfolder (PARENT_FOLDER/FOLDER1), and consumer role to other group (GROUP2) and all subfolder.

All subfolders have "Inherit Parent Space Permissions" activated, and parent folder has this space user permissions:

  • OWNER_USER: Coordinator
  • GROUP2: Consumer

The PARENT_FOLDER/FOLDER1 has:

  • GROUP1: Consumer

With this configuration:

  • GROUP2 can access to PARENT_FOLDER and all subfolders.
  • GROUP1 only to objects contained in PARENT_FOLDER/FOLDER1 (by id), but cannot access to objects from their path, and whit a CMIS client cannot make a getParent(), etc. To make it possible, PARENT_FOLDER must have GROUP1: Consumer grant, and in this case , GROUP1 could access all subfolders.

I think the solution is revoke "Inherit Parent Space Permissions" and specify this user space permissions:

  • PARENT_FOLDER:
    • OWNER_USER: Coordinator
    • GROUP1: Consumer
    • GROUP2: Consumer
  • PARENT_FOLDER/FOLDER1:
    • OWNER_USER: Coordinator
    • GROUP1: Consumer
    • GROUP2: Consumer
  • Other subfolders differents to PARENT_FOLDER/FOLDER1:
    • OWNER_USER: Coordinator
    • GROUP2: Consumer

but make it is very difficult because I can't select many subfolders and change their user permissions. I was looking to make it from database model (postgres) but I haven't got sufficient model knowledge to do it. I was looking to make this permission changes from CMIS, but I didn't find anything.

Question 1: How can I change space user permissions to many alfresco object at once?

Question 2: Do you know other way to do what I need?

Thanks.

1

1 Answers

1
votes

Go get yourself the Javascript Console from https://github.com/share-extras/js-console and set permissions with some basic scripting. Assuming you picked the parent as space, it should goes roughly like this:

space.children.forEach(function(n) {
    // use n.setPermission/removePermission/setInheritPermission
    n.save();// Not quite sure whether save is needed here
});

The ScriptNode API is at http://wiki.alfresco.com/wiki/4.0_JavaScript_API#Permission_and_Security_API.