cancel
Showing results for 
Search instead for 
Did you mean: 

Change 'Inherit Parent Space Permissions' using resfull api

orodis
Champ in-the-making
Champ in-the-making
Hi

I'm trying figure-out how can I do this using restfull api and I can not find any solutions. How can I do this? I've tried to use /api/node/{store_type}/{store_id}/{id}/rmpermissions where 'inherited' flag is displayed, but making POST request does not change anything. As I checked webscript does only permissions updates.

Does any of apis allow to turn ON/OFF parent permissions inheritance for a node?
Thanks for any help on this one.
Regards RG
1 REPLY 1

kevinr
Star Contributor
Star Contributor
The rmpermissions api (and anything that starts with rm*) is for Records Management managed nodes only.

You can use the Share API for this:

<webscript>
    <shortname>set-permissions</shortname>
    <description>Document List Component - set permissions data webscript</description>
   <url>/slingshot/doclib/permissions/{store_type}/{store_id}/{id}</url>
   <format default="json">argument</format>
   <authentication>user</authentication>
   <transaction allow="readwrite" buffersize="0">required</transaction>
  <lifecycle>internal</lifecycle>
</webscript>

It take a JSON string argument, of the form:

{
   "permissions":
   [
      {
         "authority":"kevinr",
         "role":"Coordinator",
         "remove":true
      },
      {
         "authority":"kevinr",
         "role":"Collaborator"
      }
   ]
   ,"isInherited":false
}

Take a look at permissions.get.js for more info.

So POST to that REST API with the appropriate JSON (as the appropriate user of course!) and you can manage permissions on a node and change inheritance etc.

Kev