EN : Hello ! I would like to output a list (.json) with the permissions (inherited or added on the node) of each node, from a starting node. Thank you in advance !
FR : Bonjour ! J'aimerais pouvoir sortir une liste sous forme de .json avec les permissions (héritées ou ajoutées sur le noeud) de chaque noeud, depuis un noeud de base. Merci d'avance !
Hi @LoicNicolet & welcome to Alfresco!
Passing the nodeId to the getNode API will return JSON information about the node, including its permissions.
}, "permissions": { "isInheritanceEnabled": true, "inherited": [ { "authorityId": "string", "name": "string", "accessStatus": "ALLOWED" } ], "locallySet": [ { "authorityId": "string", "name": "string", "accessStatus": "ALLOWED" } ], "settable": [ "string" ] }
Gavin Cornwell's API tutorial series is the place to start.
HTH,
Thanks for the reply, but that's not really what i would like to do.
I want to make a script that iterates through all the children, from a starting node, and take out the permissions from every child.
Thank's in advance !
You can either use the REST API, which Eddie suggested, and that will give you the permissions for a node. You can then continue to traverse the tree using the REST API grabbing the permissions from each node as you go.
The downside of this approach is that you'll make many HTTP requests for a tree of significant size.
Alternatively, you can write a web script. If you use JavaScript for your web script controller, the ScriptNode object has a getChildren method and a directPermissions property. Using those in combination you can recursively traverse the tree at any starting point using directPermissions to get the perms and using getChildren to get a list of each folder's children.
The downside of this approach is that your web script might timeout or run out of memory if the tree is extremely large.
Either way works.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.