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
Implement the create custom role endpoint defined in the ADR (#469): create a user_defined role for a single resource type with a name, description and an initial permission set, persisted via the custom-roles model (#561) and rendered to Casbin p rows in the same transaction.
Superuser-only. Enforces: single resource type per role; name validation/uniqueness; permission ids valid for the resource type; dependency closure applied (a selected permission pulls in its required dependencies). Backs the create wizard (#571–#573).
Acceptance
POST creates a custom role with resource type + permissions; p rows rendered in the same transaction.
Superuser-only; non-superuser rejected.
Single-resource-type and name-uniqueness validation (400 on violation).
Dependency closure enforced server-side (not only in the UI).
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. The server rejects a permission set that leaves out a dependency with a 400 that lists the missing permissions. The client selects dependencies from the catalog's depends_on lists before saving, so the user sees the full set. This matches the rule ADR 0034 applies to schema roles.
A taken name returns 409, not 400. Names are unique among all roles (static and custom), ignoring case.
Copying uses this same endpoint with no extra fields. The request always includes display_name, scope_types and permissions. There is no source_role field.
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:
depends_onlists before saving, so the user sees the full set. This matches the rule ADR 0034 applies to schema roles.display_name,scope_typesandpermissions. There is nosource_rolefield.