You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Backend: update custom role (metadata + permissions) endpoints #590
Implement the update custom role endpoint defined in ADR 0036: PATCH /api/authz/v1/roles/<role_id>/ changes the description, the permissions, or both, of a custom role.
Both persist via the custom-roles model (#561) and re-render the affected Casbin p rows in the same transaction. Staff or superuser only. Static roles are read-only.
Acceptance
PATCH accepts description and/or permissions and returns 200 with the role object (including user_count and updated_at).
display_name or scope_types in the request returns 400; the name and resource type cannot change.
Description is free text, may be empty, and is stored without translation.
Permissions must be non-empty and support the role's resource type; role-permission + p rows update transactionally and reach holders right away.
Under discussion: the draft Custom Roles API ADR for #469 (ADR 0036, not merged yet) proposes changes that affect this ticket. Nothing is final until the ADR is approved.
Proposed changes:
No server-side dependency closure. A PATCH whose permissions leave out a dependency, or remove one another permission still needs, is rejected with a 400 that lists the missing permissions. The client handles selection using the catalog's depends_on lists.
A taken name returns 409. Names are unique among all roles, ignoring case.
One endpoint for both updates.PATCH /api/authz/v1/roles/<role>/ accepts display_name, description and permissions. permissions replaces the full list.
Editing a static role returns 400.
updated_at changes on every edit, including permissions-only edits.
Activity
rodmgwgu commentedon Nov 5, 2026
Under discussion: the draft Custom Roles API ADR for #469 (ADR 0036, not merged yet) proposes changes that affect this ticket. Nothing is final until the ADR is approved.
Proposed changes:
PATCHwhosepermissionsleave out a dependency, or remove one another permission still needs, is rejected with a 400 that lists the missing permissions. The client handles selection using the catalog'sdepends_onlists.PATCH /api/authz/v1/roles/<role>/acceptsdisplay_name,descriptionandpermissions.permissionsreplaces the full list.updated_atchanges on every edit, including permissions-only edits.