Old Release

This documentation covers an old version of Fedora. Looking for another version? See all documentation.

 

Request URI: /path/to/some/resource/fcr:accessroles

Methods: GET, POST, DELETE

Arbitrary access roles may be set through this API. However, they are only enforced when paired with a Policy Enforcement Point that is aware of access roles.

GET Get a list of all the roles assigned to principals on this resource

Output formats: application/json

Query Parameters:

EFFECTIVE   When supplied, gets the list of effective roles for this resource, including those inherited from the parent

Example:

curl "http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessroles"

Response:

Status: 200 OK

Headers:
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(8.1.11.v20130520)

Body:

{"principal name 3":["admin"],"principal name 1":["reader"],"principal name 2":["writer"]}

Status:

200 OK: if access roles retrieved successfully

204 No Content: if access roles not assigned

404 Not Found: if the resource doesn't exist


POST Set the roles assigned on this resource

Request Headers:

CONTENT-TYPE  application/json

Example:

curl -X POST -H "Content-Type: application/json" --data-binary "@post.txt" "http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessroles"

Body:
{
   "principal name 1" : [ "reader" ],
   "principal name 2" : [ "writer" ],
   "principal name 3" : [ "admin" ]
}

Response:

Status: 201 Created

Headers:

Location: http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessroles
Content-Length: 0
Server: Jetty(8.1.11.v20130520)

Status:

201 Created: if the access roles were created successfully

400 Bad Request: if there was an error processing the access roles declaration

415 Unsupported Media Type: if the Content-Type of the uploaded content isn't application/json


DELETE Clear all roles assignments from this resource

Example:

curl -X DELETE "http://localhost:8080/rest/49/3d/24/41/493d2441-0541-41c7-a23b-09d1f17d4a0f/fcr:accessroles"

Response:

Status: 204 No Content

Headers: 
Server: Jetty(8.1.11.v20130520)

Status:

204 No Content: if the access roles are deleted successfully

404 Not Found: if the resource doesn't exist

  • No labels