Add admin auto-assignment for first user and role management UI #3
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Public/noodlenook!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/update-admin-user-role-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements automatic admin role assignment for the first registered user and adds an admin-only UI for managing user roles, eliminating the need for direct database access.
Backend Changes
adminrole when count is 0,viewerotherwise/api/usersroutes for listing users and updating roles (admin-only)GET /api/users- Returns all users with role, email, creation datePUT /api/users/:id/role- Updates user role with validationFrontend Changes
/admin): New page showing user table with inline role editing via dropdownsSecurity
authenticateTokenandauthorizeRole('admin')middleware['viewer', 'editor', 'admin']Screenshots
Admin Dashboard - User Management Interface

Header with Admin Button (visible to admins only)

Documentation
Updated
README.mdto reflect:Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.