Setting a Single Permission

The POST method accepts a single permission descriptor.

Method

URL

POST

http://<host>:<port>/jasperserver[-pro]/rest_v2/permissions

Content-Type

Content

application/json

A JSON object that describes a single permission on a single resource, for example:

{
  "uri":"/properties",
  "recipient":"role:ROLE_USER",
  "mask":"1"
}

Return Value on Success

Typical Return Values on Failure

201 Created – The request was successful.

400 Bad Request – The permission is already assigned or the given mask is invalid.

The PUT method accepts a resource and recipient in the URL.

Method

URL

PUT

http://<host>:<port>/jasperserver[-pro]/rest_v2/permissions/path/to/resource;recipient=
<recipient>

Argument

Type/Value

Description

recipient

string required

The recipient format specifies user or role, the organization if necessary, and the object ID. The slash characters must be encoded, for example:

user:joeuser%7Corganization_1

Content-Type

Content

application/json

A JSON object that describes only the mask, for example:

{
  "uri": null,
  "recipient": null,
  "mask":"2"
}

Return Value on Success

Typical Return Values on Failure

200 OK – The request was successful, and the response body contains the single permission that was modified.

400 Bad Request – If the mask is invalid.

404 Not Found – If the resource or the recipient in the URL is invalid.

Feedback