When updating permissions of an object you will need to send an encoded JSON string as the acls argument that includes the handle (id) of the authority you want to change.
Permission Options
- all
- read_all
- write_all
- manage
- write_object
- write_linked
- read_object
- read_linked
- read_history
- search
Example:
Update a single user’s permissions
{"User-11:ec2-34-228-158-26.compute-1.amazonaws.com":"read_object,read_linked,read_history,search"}
Update a group’s permissions
{"Group-7:ec2-34-228-158-26.compute-1.amazonaws.com":"read_all"}
CURL
curl -u admin:admin -X POST 'http://localhost:8081/simflofy- admin/repo/ds/acls?id=Document-54:ec2-34-228-158-26.compute-1.amazonaws.com&acls=%7B%22User-11%3Aec2-34-228-158-26.compute-1.amazonaws.com%22%3A%22manage%2Cwrite_object%2Cread_object%2Cread_linked%2Cwrite_linked%2Cread_history%2Csearch%22%7D'
Output:
{ "results": [ "test[User-11:ec2-34-228-158-26.compute-1.amazonaws.com]:manage,write_object,read_object,read_linked,write_linked,read_history,search", "admin[User-2:ec2-34-228-158-26.compute-1.amazonaws.com]:manage,write_object,read_object,read_linked,write_linked,read_history,search", "Content Administrators[Group-2:ec2-34-228-158-26.compute-1.amazonaws.com]:manage,write_object,read_object,read_linked,write_linked,read_history,search" ], "success": "true" }
Error Output:
{ "message": "Exception while setting access controls for id Document-54:ec2-34-228-158-26.compute-1.amazonaws.com and connector with id ds", "error": "In three-bit permission mode, all of the read bits must be the same value as each other and all of the write bits must be the same value as each other", "success": false }
In the above error, you are attempting to use an illegal combination of permissions.
{ "message": "Exception while setting access controls for id Document-54:ec2-34-228-158-26.compute-1.amazonaws.com and connector with id ds", "error": "Could not find connection with id ds", "success": false }
In the above error, we used a connector ID that does not exist in Federation Services.