Add user management (CRUD + admin toggle), make Settings available to all users

- New /admin/users page: create/delete users, toggle admin role, guarded against
  self-demotion/self-deletion
- Backend: GET/POST/PATCH/DELETE /api/admin/users, admin-only
- Settings moved from /admin/settings to /settings (all logged-in users); the
  password-change section shows for everyone, integration/API-key sections only
  render (and only fetch) for admins, since those endpoints stay admin-gated
- Navbar: Settings link now visible to all users; added Users nav link for admins
This commit is contained in:
Myron Blair
2026-07-26 19:21:50 -05:00
parent 0f6f03509a
commit 5b191da471
7 changed files with 237 additions and 13 deletions
+13
View File
@@ -34,6 +34,19 @@ class UserPublic(BaseModel):
created_at: str
class AdminUserCreate(BaseModel):
email: str
password: str
name: str
is_admin: bool = False
class AdminUserUpdate(BaseModel):
name: Optional[str] = None
is_admin: Optional[bool] = None
password: Optional[str] = None
# ---------- Profiles ("Who's Watching") ----------
RATING_ORDER = ["G", "PG", "PG-13", "R", "NR"]