Skip to content

[FE-34] Build /admin/users page — user table with role filter, role change, and suspend actions #846

Description

@mftee

Overview

Administrators need a user management interface to view all users, filter by role, change roles, and suspend or delete accounts. Without this page, user management must be done directly in the database.

Background

File to create: frontend/app/(protected)/admin/users/page.tsx

Access: Admin role only (redirect non-admins to /dashboard)

Features:

  • Searchable, paginated user table fetched from GET /api/users (admin endpoint — BE-15)
  • Columns: Name, Email, Role badge, Created date, Last login, Status (Active/Suspended)
  • Filters: Role dropdown, Status dropdown
  • Per-row actions:
    • "Change role" dropdown (USER / ADMIN)
    • "Suspend" / "Unsuspend" button
    • "Delete" button (with confirmation modal)
  • Bulk actions: select multiple users → bulk delete

Acceptance Criteria

  • Page shows 403 Forbidden or redirects non-admin users
  • Role change calls PATCH /api/users/:id and immediately updates the row
  • Changing own role to non-admin shows a warning
  • Delete requires typing the user's email in a confirmation modal
  • Suspended users shown with a distinct visual indicator

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions