Modify an existing role
Description
URL |
scheme://domain:port/platform/ws/role |
Description |
The logged on user must have view_configure permission on the setting resource to use this API. Modifies an existing role by redefining permissions and resources in the XML definition. Built-in roles cannot be modified. |
HTTP-Method |
PUT |
Parameters |
None |
Request
Request-Method |
PUT |
|
Request-URI |
/platform/ws/role |
|
Request-Header |
Name |
Value |
Accept |
application/xml or application/json |
|
Content-Type |
application/xml |
|
Message-body |
The XML definition of the role. For additional information, refer to the schema file ./schemas/rbac/role.xsd.
|
Notes |
The role element has two attributes: name and description. Name is required and must match that of the existing role. Possible values for permission name are:
Possible values for resource element name can be retrieved with the API platform/ws/resources. |
Response
Response |
Response Information |
|
Response Code |
|
|
Response-Header |
Name |
Value |
Content-Type |
Application/xml or application/json |
|
Location (Only if response code is 200) |
URI of the updated resource |
|
Content-Location (Only if response code is 200) |
URI of representation in the response |
|
Message-body |
Success Message | If successful, returns current information about the role. For additional information, refer to the schema file ./schemas/rbac/role.xsd.
|
Failure Message | If not successful, returns an error message. For additional information, refer to the schema file ./schemas/rbac/error.xsd.
|
Example: Modify the role test_role
# Request
PUT /platform/ws/role HTTP/1.1
Host: www.example.org
Content-Type: application/xml;
<role name="test_role">
<permissions>
<permission name="view_control">
<resources>
<resource name="own_jobs"/>
</resources>
</permission>
</permissions>
</role>
# Response
200 Successful
Location: http://www.example.org/platform/ws/roles/test_role
Content-Location: http://www.example.org/ws/platform/roles/test_role
Content-Type: application/xml;
<role name="test_role" description=”Test Role” builtIn=”false”>
<atom:link rel="self" href="http://www.example.org/ws/roles/test_role"/>
<permissions>
<permission name="view_control">
<resources>
<resource name="own_jobs"/>
</resources>
</permission>
</permissions>
</role>