Update a role
- Last Updated: February 2, 2024
- 2 minute read
- Hybrid Data Pipeline
- Version 5.0
- Documentation
Purpose
Updates the specified role
URL
https://<myserver>:<port>/api/admin/roles/{id}
Method
PUT
URL Parameters
<myserver> is the hostname or IP address of the machine hosting the Hybrid Data Pipeline server for a non-load balancer deployment, or the machine hosting the load balancer for a load balancer deployment. For a non-load balancer deployment, <port> is the port number specified as the Server Access Port during deployment. For a load balancer deployment, <port> must be either 80 for http or 443 for https. Whenever port 80 or 443 are used, it is not necessary to include the port number in the URL.
The URL parameter {id} described in the following table is required.
| Parameter | Description | Valid Values |
|---|---|---|
| {id} | The ID of the role. | The ID of a predefined role, such as a system administrator, or the ID of a role created by an administrator. The ID of a role cannot be changed. |
Request Definition
{
"name": "role_name",
"tenantId": tenant_id,
"description": "role_description",
"permissions": [permission_id,permission_id,...],
"users": [user_id,user_id,...]
}
| Property | Description | Usage | Valid Values |
|---|---|---|---|
| "name" | The name of the role. | Required | System
Administrator | User
| Tenant Administrator | custom_role
|
| "tenantId" | The ID of the tenant to which the role belongs. If not specified, it is assumed the role belongs to the user's tenant. | Optional | A valid tenant ID. |
| "description" | The description of the role. | Optional | System Administrator
role has all permissions. This role cannot be deleted, and only the
users associated with it via the "users" property can be modified.
Other properties, such as "name" and "permissions," cannot be
modified. User role has all permissions associated with a user who might query data sources directly. This role cannot be deleted, and only the users associated with it via the "users" property can be modified. Other properties, such as "name" and "permissions," cannot be modified. Tenant Administrator role has user permissions and permissions associated with provisioning users. This role cannot be deleted, and only the users associated with it via the "users" property can be modified. Other properties, such as "name" and "permissions," cannot be modified. Optionally, administrators can provide a description for any roles they create. |
| "permissions" | A list of permissions associated with the role | Required | A comma-separated list of permission IDs. See Administrator Permissions API for details. |
| "users" | A list of users granted the role | Required | A comma-separated list of user IDs. |
Sample Request Payload
{
"name": "Reader",
"tenantId": 56,
"description": "This role allows read-only access.",
"permissions": [
2,
5,
6
],
"users": []
}
Sample Server Success Response
Status code: 200
Successful response
{
"id": 29,
"name": "Reader",
"tenantId": 56,
"description": "This role allows read-only access.",
"permissions": [
2,
5,
6
],
"users": []
}
Sample Server Failure Response
{
"error":{
"code":222207916,
"message":{
"lang":"en-US",
"value":"There is no User with that id: 1234."
}
}
}
Authentication
Basic Authentication using Login ID and Password
Authorization
The user must have the Administrator (12) permission, or the ModifyRole (19) permission and administrative access on the tenant.