Setting Permissions

PUT is implemented as a synonym of POST for the permission service. Both will create an explicit permission for a given role or user on a resource, overriding the previous explicit permission for the same role or user. To set a permission use either method and include the permission descriptors (objectPermissionImpl) such as those returned by the GET method.

Method

URL

PUT or

POST

http://<host>:<port>/jasperserver[-pro]/rest/permission/path/to/resource/

Content-Type

Content

text/plain

A well-formed XML entityResource that defines the permissions you want to set.

Return Value on Success

Typical Return Value on Failure

200 OK

404 Not Found – When the specified resource URI is not found in the repository.

Setting a permission creates an explicit permission for the given user or role. To reset the inherited permission value, remove the explicit permission with the DELETE method. This method does not take a permission descriptor, instead specify the roles and users to reset to the inherited permission as parameters.

Method

URL

DELETE

http://<host>:<port>/jasperserver[-pro]/rest/permission/path/to/resource/?<argument>

Argument

Type/Value

Description

roles

String

A comma-separated list of role names. The access permission for the specified roles will revert to the resource’s inherited permission for those roles.

users

String

A comma-separated list of user IDs. The access permission for the specified users will revert to the resource’s inherited permission for those users.

Return Value on Success

Typical Return Values on Failure

200 OK

404 Not Found – When the specified resource URI is not found in the repository.

Feedback