Can't update group permission via REST API

Problem

The Rest API call to update group permissions for a Datameer artifacts fails with the following message:

Group doesn’t exist or isn’t accessible with current permissions

 

curl -u 'login:password' -X PUT -H 'Content-Type:application/json' -d '{name="<group_name>",flags:{executable:true,readable:true,writale:true}}' 'http://host:port/api/filesystem/files/<ID>/permission/groups/<group_name>'


Cause

The user mixes the usage of PUT and POST methods while setting a new group permission or changing existing ones.

Solution

Use the correct method for desired action.

 

Create a Group Permission for a File
Request method - POST
Description - Sets new permissions for groups created in Datameer.
URI syntax:

curl -u '<username>:<password>' -X POST -H  'Content-Type:application/json' -d '{name="<group>",flags:{executable:<true> or <false>,readable:<true> or <false>,writable:<true> or <false>}}' 'http://<Datameer-serverIP>:<port-number>/api/filesystem/files/<file-id> or <uuid>/permission/groups'

 

Change the Group Permission for a File
Request method - PUT
Description - Changes existing permissions for groups created in Datameer.
URI syntax:

curl -u '<username>:<password>' -X PUT -H 'Content-Type:application/json' -d '{name="<group>",flags:{executable:<false> or <true>,readable:<false> or <true>,writable:<false> or <true>}}' 'http://<Datameer-serverIP>:<port-number>/api/filesystem/files/<file-id> or <uuid>/permission/groups/<group>'