The role Service

The role service allows administrators to view, create, edit, and delete role definitions. However, the role service does not define role membership. To add users to a role, edit the user’s properties, as described in Editing a User.

The GET method of the role service returns descriptors for all roles that match the search string. In commercial editions, the scope of the search is the administrator’s organization and all suborganizations. In the community project, there are no organizations, and the scope is all roles defined in the server. If no search string is specified, all roles are returned. If no roles match the search string, the method returns an empty list.

Method

URL

GET

http://<host>:<port>/jasperserver[-pro]/rest/role/<searchString>/

Return Value on Success

Typical Return Values on Failure

200 OK – The content is a descriptor for each of the roles that match the search.

 

In commercial editions, roles defined in an organization specify its ID in the tenantID element. System roles that appear in every organization are listed without a tenantID property. The community project does not have organizations and thus does not specify the tenantId element on any roles.

<roles>
  <role>
    <externallyDefined>false</externallyDefined>
    <roleName>ROLE_ADMINISTRATOR</roleName>
  </role>
  <role>
    <externallyDefined>false</externallyDefined>
    <roleName>ROLE_ANONYMOUS</roleName>
  </role>
  <role>
    <externallyDefined>false</externallyDefined>
    <roleName>ROLE_DEMO</roleName>
  </role>
  <role>
    <externallyDefined>false</externallyDefined>
    <roleName>ROLE_SUPERMART_MANAGER</roleName>
  </role>
  <role>
    <externallyDefined>false</externallyDefined>
    <roleName>ROLE_USER</roleName>
  </role>
  <role>
    <externallyDefined>false</externallyDefined>
    <roleName>ROLE_SAMPLE</roleName>
    <tenantId>organization_1</tenantId>
  </role>
</roles>
Version: 
Feedback