Skip to content

Admin User Management ## Business Purpose Allow superusers to manage all platform users: view list, create, edit, and delete user accounts, and assign roles. ## Current Behaviors - View All Users: The admin route fetches all users and displays them in a table with actions admin.tsx:12.

  • Add User: AddUser form collects name, email, password, and superuser flag AddUser.tsx:48.
  • Edit User: EditUser pre-fills data and allows updating any user's details EditUser.tsx:47.
  • Delete User: DeleteUser confirmation dialog removes a user DeleteUser.tsx:27.
  • Actions Menu: UserActionsMenu provides edit, delete options per user UserActionsMenu.tsx:19.
  • Role Enforcement: Only superusers can access admin pages; normal users get a 403 deps.py:52. ## Technical Implementation - Frontend Route: Admin page at _layout/admin.tsx:12-58 with getUsersQueryOptions.
  • API SDK: readUsers, createUser, updateUser, deleteUser sdk.gen.ts:248.
  • Backend Endpoints: Routes in users.py:37-215 with CRUD operations.
  • Permissions: get_current_active_superuser dependency deps.py:52.
  • Testing: test_users.py covers all admin user management operations.
  • E2E Tests: admin.spec.ts covers creating, editing, deleting users through the UI. ## Definition of Done - Admin sees a paginated table of all users admin.spec.ts:7.
  • Adding a user shows the new user in the table admin.spec.ts:45.
  • Editing a user updates their information admin.spec.ts:99.
  • Deleting a user removes them from the system admin.spec.ts:168.
  • Non-superuser trying to access admin page is redirected or shown 403 test_users.py:132.