Roles¶
roles ¶
Roles resource group.
Wraps the org-scoped Roles endpoints:
GET /v1/compliance/organizations/{org_uuid}/roles— offset- paginated list of roles.GET /v1/compliance/organizations/{org_uuid}/roles/{role_id}— single role fetch.GET /v1/compliance/organizations/{org_uuid}/roles/{role_id}/permissions— offset-paginated list of permissions attached to a role.
Every method takes org_uuid because the endpoints live under the
organisation path. Enumerate organisations via
list
to obtain UUIDs.
Role
dataclass
¶
An RBAC role defined inside an organisation.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Tagged role identifier. |
name |
str
|
Display name. |
description |
str
|
Free-form description. |
created_at |
str | None
|
ISO 8601 creation timestamp, or |
updated_at |
str | None
|
ISO 8601 last-update timestamp, or |
extra |
dict[str, Any]
|
Any additional fields the API adds in a later revision. |
from_dict
classmethod
¶
Build a Role from one decoded record.
Permission
dataclass
¶
A single permission attached to a role.
Permissions are flat triples of (resource type, resource id, action) — the role grants its holders the named action on the addressed resource.
Attributes:
| Name | Type | Description |
|---|---|---|
resource_type |
str
|
Type of resource the permission applies to
(e.g. |
resource_id |
str
|
Identifier of the specific resource, or a wildcard when the role grants on all of them. |
action |
str
|
Action permitted on the resource (e.g. |
extra |
dict[str, Any]
|
Any additional fields the API adds in a later revision. |
from_dict
classmethod
¶
Build a Permission from one decoded record.
Roles ¶
Synchronous client for the Roles endpoints.
list ¶
Fetch one offset-paginated page of roles in an organisation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
org_uuid
|
str
|
Organisation UUID. |
required |
limit
|
int | None
|
Maximum results per page (default 500, max 1000). |
None
|
page
|
str | None
|
Opaque pagination token from a prior response. |
None
|
iter ¶
Iterate every role in an organisation, auto-paginating.
list_permissions ¶
list_permissions(
org_uuid: str,
role_id: str,
*,
limit: int | None = None,
page: str | None = None
) -> OffsetPage[Permission]
Fetch one offset-paginated page of permissions for a role.
iter_permissions ¶
iter_permissions(
org_uuid: str, role_id: str, *, limit: int | None = None
) -> Iterator[Permission]
Iterate every permission on a role, auto-paginating.
AsyncRoles ¶
Asynchronous client for the Roles endpoints.
list
async
¶
Async analogue of list.
iter ¶
Async analogue of iter.
list_permissions
async
¶
list_permissions(
org_uuid: str,
role_id: str,
*,
limit: int | None = None,
page: str | None = None
) -> OffsetPage[Permission]
Async analogue of list_permissions.
iter_permissions ¶
iter_permissions(
org_uuid: str, role_id: str, *, limit: int | None = None
) -> AsyncIterator[Permission]
Async analogue of iter_permissions.