API v2: Role-Based Capabilities πŸ†•ΒΆ


Data StructuresΒΆ

RoleCapabilityModelsΒΆ

Attribute

Type

Required

Description

id

string

Read-only, unique policy identifier. Protected.

subject_id

string

yes

Read-only; Immutable; Uniqueness is required in the combination of attribute subject_id with attribute object_id.

object_id

string

yes

Read-only; Immutable; Uniqueness is required in the combination of attribute object_id with attribute subject_id. Requires read right on the target object (account, group, pool, safe, server, or user, depending on the endpoint) for GET requests.

rights

string-array {read, modify, delete, block}; readwrite; default value read

yes

Expensive to use.

object_name

string

yes

Expensive to use.

subject_name

string

yes

Expensive to use.

created_at

datetime

Read-only. Timestamp of creation.

modified_at

datetime

Read-only. Timestamp of modification.

removed

boolean

Read-only.

Retrieve Available Attributes of the RoleCapabilityModelsΒΆ

Request

Method

GET

Paths

  • /api/v2/objspec/role_account_capability

  • /api/v2/objspec/role_group_capability

  • /api/v2/objspec/role_pool_capability

  • /api/v2/objspec/role_safe_capability

  • /api/v2/objspec/role_server_capability

  • /api/v2/objspec/role_user_capability

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

GET

Paths

  • /api/v2/capability/role/account

  • /api/v2/capability/role/group

  • /api/v2/capability/role/pool

  • /api/v2/capability/role/safe

  • /api/v2/capability/role/server

  • /api/v2/capability/role/use

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

POST

Paths

  • /api/v2/capability/role/account

  • /api/v2/capability/role/group

  • /api/v2/capability/role/pool

  • /api/v2/capability/role/safe

  • /api/v2/capability/role/server

  • /api/v2/capability/role/user

Headers

Content-Type: Application/json

Body

RoleCapabilityModels

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

GET

Paths

  • /api/v2/capability/role/<subject_id>/account/<object_id>

  • /api/v2/capability/role/<subject_id>/group/<object_id>

  • /api/v2/capability/role/<subject_id>/pool/<object_id>

  • /api/v2/capability/role/<subject_id>/safe/<object_id>

  • /api/v2/capability/role/<subject_id>/server/<object_id>

  • /api/v2/capability/role/<subject_id>/user/<object_id>

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

PATCH

Paths

  • /api/v2/capability/role/<subject_id>/account/<object_id>

  • /api/v2/capability/role/<subject_id>/group/<object_id>

  • /api/v2/capability/role/<subject_id>/pool/<object_id>

  • /api/v2/capability/role/<subject_id>/safe/<object_id>

  • /api/v2/capability/role/<subject_id>/server/<object_id>

  • /api/v2/capability/role/<subject_id>/user/<object_id>

Headers

Content-Type: Application/json

Body

RoleCapabilityModels

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

PATCH

Paths

  • /api/v2/capability/role/<subject_id>/account/<object_id>/grant

  • /api/v2/capability/role/<subject_id>/group/<object_id>/grant

  • /api/v2/capability/role/<subject_id>/pool/<object_id>/grant

  • /api/v2/capability/role/<subject_id>/safe/<object_id>/grant

  • /api/v2/capability/role/<subject_id>/server/<object_id>/grant

  • /api/v2/capability/role/<subject_id>/user/<object_id>/grant

Headers

Content-Type: Application/json

Body

RoleCapabilityModels

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

PATCH

Paths

  • /api/v2/capability/role/<subject_id>/account/<object_id>/revoke

  • /api/v2/capability/role/<subject_id>/group/<object_id>/revoke

  • /api/v2/capability/role/<subject_id>/pool/<object_id>/revoke

  • /api/v2/capability/role/<subject_id>/safe/<object_id>/revoke

  • /api/v2/capability/role/<subject_id>/server/<object_id>/revoke

  • /api/v2/capability/role/<subject_id>/user/<object_id>/revoke

Headers

Content-Type: Application/json

Body

RoleCapabilityModels

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

DELETE

Paths

  • /api/v2/capability/role/<subject_id>/account/<object_id>

  • /api/v2/capability/role/<subject_id>/group/<object_id>

  • /api/v2/capability/role/<subject_id>/pool/<object_id>

  • /api/v2/capability/role/<subject_id>/safe/<object_id>

  • /api/v2/capability/role/<subject_id>/server/<object_id>

  • /api/v2/capability/role/<subject_id>/user/<object_id>

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"
}