RBAC API
Table of Contents
upsquad/rbac/v1/rbac.proto
AssignRoleRequest
AssignRoleRequest creates a scoped role assignment.
| Field | Type | Label | Description |
|---|---|---|---|
| member_id | string | member_id receives the grant. | |
| role_id | string | role_id is the role to grant. | |
| scope_type | ScopeType | scope_type identifies the grant's scope. | |
| scope_id | string | scope_id is the unit or member id; ignored when scope_type=GLOBAL. |
AssignRoleResponse
AssignRoleResponse returns the new assignment.
| Field | Type | Label | Description |
|---|---|---|---|
| assignment | RoleAssignment | assignment is the newly created role assignment. |
CapabilityMeta
CapabilityMeta is one column header in the access grid: the capability catalog entry plus its clearance floor. Returned alongside the grid so the matrix UI renders columns + floors without a second fetch.
| Field | Type | Label | Description |
|---|---|---|---|
| key | string | key is the canonical capability key, e.g. "code-write". | |
| label | string | label is the human-readable column header, e.g. "Write Code". | |
| description | string | description is the one-line explainer surfaced in the column tooltip. | |
| min_clearance | int32 | min_clearance is the clearance floor (1..5) the capability requires. |
CapabilityVerdict
CapabilityVerdict is one cell in the access grid: the effective access of a member for a single capability.
| Field | Type | Label | Description |
|---|---|---|---|
| capability | string | capability is the capability key this verdict is for, e.g. "deploy". | |
| allowed | bool | allowed is true iff reason == ACCESS_REASON_OK. | |
| reason | AccessReason | reason explains the verdict (ok |
ClearanceLevel
ClearanceLevel describes one tier of the 5-level clearance hierarchy plus the count of members from the caller's tenant currently sitting at that tier. Labels and descriptions are platform-canonical (PRD §P4.5.1) — the server is the single source of truth so frontends can never drift.
| Field | Type | Label | Description |
|---|---|---|---|
| level | int32 | level is the numeric tier in the closed range [1, 5]. The platform never introduces L0 or L6; if you need a sentinel use the absence of an entry rather than a magic value. | |
| label | string | label is the canonical human-readable tier name, e.g. "L1 Observer" or "L5 Admin". UI surfaces render this verbatim — they MUST NOT recompute it from the level integer. | |
| description | string | description is the canonical one-liner explaining what members at this tier can do. UI surfaces use this in tooltips and the legend strip on the redesigned Org page. | |
| member_count | int32 | member_count is the tenant-scoped count of non-deleted members (status='active') currently assigned to this clearance level. RLS on the members table guarantees the count cannot bleed across tenants. A tier with no members returns 0 rather than being omitted. |
CreateRoleRequest
CreateRoleRequest creates a new custom role.
| Field | Type | Label | Description |
|---|---|---|---|
| slug | string | slug is the machine identifier, unique per tenant. | |
| display_name | string | display_name is the human-readable label. | |
| description | string | description is a one-line summary. | |
| permission_ids | string | repeated | permission_ids is the initial permission set. |
CreateRoleResponse
CreateRoleResponse returns the created role.
| Field | Type | Label | Description |
|---|---|---|---|
| role | Role | role is the newly created role. |
DeleteRoleRequest
DeleteRoleRequest identifies a role for deletion.
| Field | Type | Label | Description |
|---|---|---|---|
| id | string | id is the role id. |
DeleteRoleResponse
DeleteRoleResponse acknowledges deletion.
GetClearanceLegendRequest
GetClearanceLegendRequest has no fields — the legend is implicit in the caller's authenticated tenant context (org_id is read from the scope middleware, identical to every other RPC). Reserved for future filters (e.g. include_zero_counts) so the message exists today.
GetClearanceLegendResponse
GetClearanceLegendResponse returns the five-level clearance legend annotated with per-tenant member counts.
| Field | Type | Label | Description |
|---|---|---|---|
| levels | ClearanceLevel | repeated | levels are returned in ascending order (level=1..5). The slice is always exactly five entries; tenants with zero members at a level see member_count=0 rather than a missing entry. |
GetRoleRequest
GetRoleRequest identifies a role by id.
| Field | Type | Label | Description |
|---|---|---|---|
| id | string | id is the role id. |
GetRoleResponse
GetRoleResponse returns a single role with its permissions.
| Field | Type | Label | Description |
|---|---|---|---|
| role | Role | role is the requested role. |
ListAssignmentsRequest
ListAssignmentsRequest lists role assignments with optional filters.
| Field | Type | Label | Description |
|---|---|---|---|
| member_id | string | member_id filters to a specific member; empty matches all. | |
| role_id | string | role_id filters to a specific role; empty matches all. | |
| scope_type | ScopeType | scope_type filters by scope type; SCOPE_TYPE_UNSPECIFIED matches all. | |
| scope_id | string | scope_id filters by scope id; empty matches all. |
ListAssignmentsResponse
ListAssignmentsResponse returns matching assignments.
| Field | Type | Label | Description |
|---|---|---|---|
| assignments | RoleAssignment | repeated | assignments is the list of matching role assignments. |
ListPermissionsRequest
ListPermissionsRequest requests the permission catalog.
| Field | Type | Label | Description |
|---|---|---|---|
| category | string | category optionally filters by permission category prefix. |
ListPermissionsResponse
ListPermissionsResponse returns the permission catalog.
| Field | Type | Label | Description |
|---|---|---|---|
| permissions | Permission | repeated | permissions is the ordered catalog. |