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: read and remove custom role endpoints #581
Implement the read one role and remove custom role endpoints defined in ADR 0036:
Read — GET /api/authz/v1/roles/<role_id>/ returns one role, static or custom (backs the role detail view).
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.
Activity
[-]Backend: delete custom role[/-][+]Backend: read and remove custom role endpoints[/+]feat: add the endpoints to read and remove custom roles
feat: add the endpoints to read and remove custom roles
feat: add the endpoints to read and remove custom roles
feat: add the endpoints to read and remove custom roles
feat: add the endpoints to read and remove custom roles
feat: add the endpoints to read and remove custom roles (#656)