RBAC plan step 3 (individual capabilities), registry part.
What
A member can hold capabilities on top of their one bundle. They live in the Keycloak user attribute extra_capabilities (written like org_roles, read-merge-write of the attributes, cleared when the member leaves). The tenant-context mapper puts it into the token (orca-platform PR, applied to the realm separately).
POST /v1/tenants/{id}/members/{uid}/capabilities{"capability"} and DELETE …/capabilities/{cap}.
Rules (plan §4): the acting person is an active member who holds registry:members.manage (bundle or extra), never acts on themselves, and grants only what they hold (not_held). in_bundle when the bundle grants it already.
Four-eyes: an administration capability (admin in the catalogue) becomes an open request (new table capability_requests, migration 0029). A second such person approves (POST /v1/tenants/{id}/capability-requests/{rid}/approve) or rejects (DELETE …/{rid}); the requester and the member cannot approve. Revoking a capability withdraws its open request; removing a member drops theirs.
A role change keeps the extras.
authn.Principal parses the extra_capabilities claim. The registry's own checks still go by org_roles (unchanged): an extra such as registry:members.manage works through the portal (service client), not yet with a person's own token against the registry. Moving the registry's handlers onto capabilities is a separate decision.
RBAC plan step 3 (individual capabilities), registry part.
**What**
- A member can hold capabilities on top of their one bundle. They live in the Keycloak user attribute `extra_capabilities` (written like `org_roles`, read-merge-write of the attributes, cleared when the member leaves). The tenant-context mapper puts it into the token (orca-platform PR, applied to the realm separately).
- `POST /v1/tenants/{id}/members/{uid}/capabilities` `{"capability"}` and `DELETE …/capabilities/{cap}`.
- Rules (plan §4): the acting person is an active member who holds `registry:members.manage` (bundle or extra), never acts on themselves, and grants only what they hold (`not_held`). `in_bundle` when the bundle grants it already.
- Four-eyes: an administration capability (`admin` in the catalogue) becomes an open request (new table `capability_requests`, migration 0029). A second such person approves (`POST /v1/tenants/{id}/capability-requests/{rid}/approve`) or rejects (`DELETE …/{rid}`); the requester and the member cannot approve. Revoking a capability withdraws its open request; removing a member drops theirs.
- A role change keeps the extras.
- `authn.Principal` parses the `extra_capabilities` claim. The registry's own checks still go by `org_roles` (unchanged): an extra such as `registry:members.manage` works through the portal (service client), not yet with a person's own token against the registry. Moving the registry's handlers onto capabilities is a separate decision.
- Audit: `user.capability_granted|requested|revoked|request_rejected|request_withdrawn`.
**Behaviour change:** none until someone is granted an extra; nobody holds one today.
**Tests:** handler rules, four-eyes, user tokens, Keycloak adapter (other attributes survive), store on memory and Postgres, OpenAPI.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
A member can hold capabilities on top of their bundle. They live in the
Keycloak user attribute extra_capabilities, which the tenant-context
mapper puts into the token; the registry writes it like org_roles and
clears it when the member leaves.
- POST/DELETE /v1/tenants/{id}/members/{uid}/capabilities[/{cap}]
- a person who holds registry:members.manage grants, never on
themselves, and only what they hold themselves
- an administration capability waits for a second person: open
requests in capability_requests (0029), approve or reject under
/v1/tenants/{id}/capability-requests
- a role change keeps the extras; the principal parses the claim, the
registry's own checks still go by org_roles
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
sharang
merged commit c18f0dc945 into main2026-11-11 12:48:54 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
RBAC plan step 3 (individual capabilities), registry part.
What
extra_capabilities(written likeorg_roles, read-merge-write of the attributes, cleared when the member leaves). The tenant-context mapper puts it into the token (orca-platform PR, applied to the realm separately).POST /v1/tenants/{id}/members/{uid}/capabilities{"capability"}andDELETE …/capabilities/{cap}.registry:members.manage(bundle or extra), never acts on themselves, and grants only what they hold (not_held).in_bundlewhen the bundle grants it already.adminin the catalogue) becomes an open request (new tablecapability_requests, migration 0029). A second such person approves (POST /v1/tenants/{id}/capability-requests/{rid}/approve) or rejects (DELETE …/{rid}); the requester and the member cannot approve. Revoking a capability withdraws its open request; removing a member drops theirs.authn.Principalparses theextra_capabilitiesclaim. The registry's own checks still go byorg_roles(unchanged): an extra such asregistry:members.manageworks through the portal (service client), not yet with a person's own token against the registry. Moving the registry's handlers onto capabilities is a separate decision.user.capability_granted|requested|revoked|request_rejected|request_withdrawn.Behaviour change: none until someone is granted an extra; nobody holds one today.
Tests: handler rules, four-eyes, user tokens, Keycloak adapter (other attributes survive), store on memory and Postgres, OpenAPI.
🤖 Generated with Claude Code
https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf
A member can hold capabilities on top of their bundle. They live in the Keycloak user attribute extra_capabilities, which the tenant-context mapper puts into the token; the registry writes it like org_roles and clears it when the member leaves. - POST/DELETE /v1/tenants/{id}/members/{uid}/capabilities[/{cap}] - a person who holds registry:members.manage grants, never on themselves, and only what they hold themselves - an administration capability waits for a second person: open requests in capability_requests (0029), approve or reject under /v1/tenants/{id}/capability-requests - a role change keeps the extras; the principal parses the claim, the registry's own checks still go by org_roles Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aRnCGqELxoix5TfpX8Ejf