Skip to content

Backend: read and remove custom role endpoints #581

Done

Description

@rodmgwgu

Implement the read one role and remove custom role endpoints defined in ADR 0036:

  1. Read — GET /api/authz/v1/roles/<role_id>/ returns one role, static or custom (backs the role detail view).
  2. Remove — DELETE /api/authz/v1/roles/<role_id>/ removes a custom role (backs the row and detail kebab Frontend: Delete custom role (row + detail kebab) #584). A role with assignments is removed only when the request confirms revoking them with assignments=revoke ("Delete anyway"). Reassigning members before removal is not supported.

Removal follows ADR 0035: the definition stays, marked as removed, so its ID is never reused; its role-permission rows, Casbin p rows and assignments are deleted in the same transaction. Static roles are read-only.

Acceptance

  • GET returns 200 with the role object of the role list (including user_count and updated_at). The caller needs the read permission ADR 0028 requires for the role's resource type (courses.view_course_team or content_libraries.view_library_team); staff and superusers always pass. Otherwise 403.
  • DELETE is staff or superuser only; other users get 403.
  • DELETE returns 204. A role with assignments and no assignments=revoke returns 409 and removes nothing; any other assignments value returns 400. A role with no assignments is removed without the parameter.
  • DELETE on a static role returns 400.
  • An unknown or removed role returns 404 on GET and DELETE, and a removed role is left out of the role list.
  • Audit trail follows separately (Implementation: Custom roles audit trail #588).

Activity

  1. added
    willow
    on Oct 30, 2026
  2. changed the title [-]Backend: delete custom role[/-] [+]Backend: read and remove custom role endpoints[/+] on Nov 23, 2026
  3. self-assigned this
    on Nov 23, 2026
  4. moved this to In Progress in RBAC AuthZ Boardon Nov 23, 2026
  5. added 3 commits that reference this issue on Nov 25, 2026
    19fbb97
    fef600f
    e5f125e
  6. moved this from In Progress to In Review in RBAC AuthZ Boardon Nov 25, 2026
  7. added 2 commits that reference this issue on Nov 30, 2026
    6e0f0d6
    5e43abf
  8. added a commit that references this issue on Dec 2, 2026
    217653d
  9. moved this from In Review to Done in RBAC AuthZ Boardon Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

willow

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions