API v2: Role-Based Capabilities πΒΆ
Data StructuresΒΆ
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Read-only, unique policy identifier. Protected. |
|
|
string |
yes |
Read-only; Immutable; Uniqueness is required in the combination of attribute |
|
string |
yes |
Read-only; Immutable; Uniqueness is required in the combination of attribute |
|
string-array {read, modify, delete, block}; readwrite; default value |
yes |
Expensive to use. |
|
string |
yes |
Expensive to use. |
|
string |
yes |
Expensive to use. |
|
datetime |
Read-only. Timestamp of creation. |
|
|
datetime |
Read-only. Timestamp of modification. |
|
|
boolean |
Read-only. |
Retrieve Available Attributes of the RoleCapabilityModelsΒΆ
Request
Method |
|
Paths |
|
To check allowed methods, available URL parameters and possible responses please refer to the API Overview section.
Get Role-Based Capabilities for ObjectsΒΆ
Request
Method |
|
Paths |
|
Example Request
GET /api/v2/capability/role/account
curl -s -k -X GET \
-H 'Authorization: sgfeea6jsaz4mum9su8w6' \
'https://10.31.87.227/api/v2/capability/role/account'
Response
{
"result": "success",
"role_account_capability": [
{
"subject_id": "9115285645797883906",
"object_id": "9115285645797883907",
"rights": [
"read"
],
"object_name": "ad-user1-windows",
"subject_name": "admin",
"created_at": "2025-04-30 02:08:09.033964-07",
"modified_at": "2025-04-30 02:08:09.033964-07"
},
{
"subject_id": "9115285645797883906",
"object_id": "9115285645797883908",
"rights": [
"read"
],
"object_name": "jools-Linux",
"subject_name": "admin",
"created_at": "2025-04-30 02:12:19.542946-07",
"modified_at": "2025-04-30 02:12:19.542946-07"
}
]
}
Assign Role-Based Capabilities for ObjectsΒΆ
Request
Method |
|
Paths |
|
Headers |
|
Body |
|
Example Request
POST /api/v2/capability/role/user
curl -s -k -X POST \
-H 'Authorization:sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.31.87.227/api/v2/capability/role/user' \
-d'{"subject_id":9115285645797883906,"object_id":9115285645797883906}'
Response
{
"result": "success"
}
Get Rights Assigned to a Role (Subject) for an Object by Their IDsΒΆ
Request
Method |
|
Paths |
|
Example Request
GET /api/v2/capability/role/<subject_id>/user/<object_id>
curl -s -k -X GET \
-H 'Authorization:sgfeea6jsaz4mum9su8w6' \
'https://10.31.87.227/api/v2/capability/role/9115285645797883906/user/9115285645797883906'
Response
{
"result": "success",
"role_user_capability": {
"subject_id": "9115285645797883906",
"object_id": "9115285645797883906",
"rights": [
"read",
"modify",
"delete",
"session-view"
],
"object_name": "User_1",
"subject_name": "admin",
"created_at": "2025-04-30 02:39:21.424866-07",
"modified_at": "2025-04-30 03:47:33.568186-07"
}
}
Modify Rights Assigned to a Role (Subject) for an Object by Their IDsΒΆ
Request
Method |
|
Paths |
|
Headers |
|
Body |
|
Example Request
PATCH /api/v2/capability/role/<subject_id>/user/<object_id>
curl -s -k -X PATCH \
-H 'Authorization:sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.31.87.227/api/v2/capability/role/9115285645797883906/user/9115285645797883906' \
-d'{"rights":["read","modify","delete","session-view"]}'
Note
The read right is mandatory and must always be included.
Response
{
"result": "success"
}
Grant Specific Rights to a Role (Subject) for an Object by Their IDsΒΆ
Request
Method |
|
Paths |
|
Headers |
|
Body |
|
Example Request
PATCH /api/v2/capability/role/<subject_id>/user/<object_id>/grant
curl -s -k -X PATCH \
-H 'Authorization:sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.31.87.227/api/v2/capability/role/9115285645797883906/user/9115285645797883906/grant' \
-d'{"rights":["modify","delete","session-view"]}'
Response
{
"result": "success"
}
Revoke Specific Rights to a Role (Subject) for an Object by Their IDsΒΆ
Request
Method |
|
Paths |
|
Headers |
|
Body |
|
Example Request
PATCH /api/v2/capability/role/<subject_id>/user/<object_id>/revoke
curl -s -k -X PATCH \
-H 'Authorization:sgfeea6jsaz4mum9su8w6' \
-H 'Content-Type: application/json' \
'https://10.31.87.227/api/v2/capability/role/9115285645797883906/user/9115285645797883906/revoke' \
-d'{"rights":["modify","delete","session-view"]}'
Response
{
"result": "success"
}
Delete Role-Based Capability Assigned to a Role (Subject) for an Object by Their IDsΒΆ
Request
Method |
|
Paths |
|
Example Request
DELETE /api/v2/capability/role/<subject_id>/user/<object_id>
curl -s -k -X DELETE \
-H 'Authorization:sgfeea6jsaz4mum9su8w6' \
'https://10.31.87.227/api/v2/capability/role/9115285645797883906/user/9115285645797883906'
Response
{
"result": "success"
}