How to use REST API to change "other" permissions of a file?

1 follower

The documentation specifies the following but i'm not sure how to use it.

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/others'
curl -u 'nikhil:password' -X PUT -H 'Content-Type:application/json' -d '{name="datameer_users",flags:{executable:true,readable:true,writable:false}}' '<uuid>/permission/others'
I filled in the <uuid>  with the uuid of the artifact whose permission I am trying to change.
Am I doing something wrong ? because this keeps throwing an error.
Nikhil Srinidhi

1 comment

  • Avatar

    Hello Nikhil,

    it seems that the command is not fully correct. Please try the following, which is working in my test environment

    curl -v -k -u "nikhil:<pass>" -w"\n%{http_code}\n" -X PUT -H 'Content-Type:application/json' -d "{executable:false,readable:false,writable:false}" "http://<IP>:8080/api/filesystem/files/<UUID>/permission/others"

    In general I like to recommend to use REST call with HTTP Status Code included 

    curl -s -k -u "<user>:<pass>" -w"\n%{http_code}\n" ...

    or with additional verbose messages for debugging purpose

    curl -v -k -u "<user>:<pass>" -w"\n%{http_code}\n" ...
Please sign in to leave a comment.