Skip to content

feat: Expand user role model (admin / creator / operator / user) #143

Closed

Description

@vybe

Summary

The current system has only two effective roles — admin (password login) and user (all whitelisted email/Auth0 accounts). This is too coarse as the platform opens to more people.

Proposed 4-Tier Role Model

Role Entry Path Intent
admin Password login Full platform control — infra, users, agents, system settings
creator Whitelisted email Can create and manage their own agents, access templates
operator Whitelisted email Can use/run existing agents, trigger tasks — no agent creation
user Public links / open signup Can interact with agents via shared public links only

Acceptance Criteria

Backend

  • Extend role column in users table to accept admin | creator | operator | user
  • New email-authenticated users default to creator (current behaviour was user) — configurable
  • Public-link-authenticated sessions are treated as user role
  • require_role(min_role) dependency helper for endpoints (ordered: admin > creator > operator > user)
  • Agent creation endpoints require creator or above
  • Admin-only endpoints (require_admin) unchanged

Frontend / Settings

  • User management table in Settings showing all users with their current role
  • Admin can change any user's role via dropdown
  • Role badge shown next to user names where relevant (e.g. email whitelist, user profile)

Out of Scope (follow-up)

  • Per-role token limits → tracked separately
  • Per-role feature flags

Notes

  • Current schema: role TEXT NOT NULL DEFAULT 'user' in users table (db/schema.py:39)
  • Role checks currently hardcoded as user["role"] == "admin" — these stay as-is; new checks layer on top

Activity

  1. added
    enhancement
    priority-p1
    on Mar 16, 2026
  2. added 6 commits that reference this issue on Mar 20, 2026
    6a9c86b
    7c48635
    b8a9725
    9c52191
    c9af39f
    8c4f583
  3. vybe commented on Apr 4, 2026

    @vybe
    ContributorAuthor

    Status update (2026-04-04): Partially implemented. Commit c9af39f added the 4-tier role model concept, but the backend still only checks role == "admin" — no require_role() helper, no creator/operator enforcement on endpoints, and no frontend role management UI. Remaining work:

    • require_role(min_role) dependency helper
    • Agent creation endpoints gated to creator+
    • User management table in Settings with role dropdown
    • Role badge display
  4. added a commit that references this issue on Apr 11, 2026
    2f46af0
  5. added
    complexity-medium
    on Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-mediumenhancementpriority-p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions