Skip to content

feat: add role-based authorization with admin endpoint#11

Merged
amrtgaber merged 1 commit intomainfrom
feat/role-based-auth
Feb 2, 2026
Merged

feat: add role-based authorization with admin endpoint#11
amrtgaber merged 1 commit intomainfrom
feat/role-based-auth

Conversation

@amrtgaber
Copy link
Contributor

Introduce a role field on the User model (default: "user") backed by
a plain String(50) column, a require_role() dependency factory that
gates routes by role while letting superusers bypass, and a dedicated
PATCH /admin/users/{user_id}/role endpoint for admins to update roles.

UserCreate and UserUpdate are unchanged — role is read-only via UserRead
and writable only through the admin endpoint.

@amrtgaber amrtgaber merged commit d3caa38 into main Feb 2, 2026
2 checks passed
@amrtgaber amrtgaber deleted the feat/role-based-auth branch February 2, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant