Commit Graph

9 Commits

Author SHA1 Message Date
marko-kraemer ddf2d32f59 feat(admin): add user thread viewer with admin access bypass
 Features:
- Add admin portal thread viewer with pagination
- Display thread list with project names and public status
- Add clickable links to view threads via /share/{thread_id}
- Add admin bypass for accessing all threads (public and private)

🔧 Backend Refactoring:
- Consolidate admin APIs into admin_api.py and billing_admin_api.py
- Remove unused files: users_admin.py, admin/api.py
- Remove unused endpoints: user search, grant-bulk-credits, migrate-user
- Update admin thread endpoint to use share URLs

 Performance:
- Remove message_count from UserThreadSummary (optimization)
- Remove N+1 query issue in thread listing

🔒 Authorization:
- Add admin role bypass in verify_and_authorize_thread_access
- Create RLS migration (20251005160000_admin_roles_access.sql)
- Update thread_select_policy for admin access
- Update message_select_policy for admin access
- Update project_select_policy for admin access
- Update agent_runs_select_policy for admin access

💻 Frontend:
- Add Threads tab to admin user details dialog
- Add useAdminUserThreads hook with pagination
- Remove unused admin hooks (useAdminUserSearch, useAdminAdvancedSearch)
- Display thread metadata with Open button and ExternalLink icon

🗃️ Database:
- Apply RLS policies allowing admin/super_admin roles to bypass restrictions
- Admins can now view any thread, message, project, or agent_run

This enables admins to view and debug any user's threads through the
share page interface, regardless of public/private status.
2025-10-05 18:09:26 +02:00
Saumya 549b50d9c5 fic billing circus 2025-09-29 15:01:55 +05:30
Saumya 677b02bbd8 critical: fix billing overcharge 2025-09-29 14:09:01 +05:30
marko-kraemer 079d7347da model changes 2025-09-28 23:36:14 +02:00
Saumya 3b9fb65564 fix yearly commitment credits renewal 2025-09-23 13:42:09 +05:30
Saumya e1c1cc3523 fix yearly commitment tracking 2025-09-23 12:37:03 +05:30
marko-kraemer 58457002a7 billing checks simplify 2025-09-21 17:55:27 +02:00
marko-kraemer 31c697f774 billing rem old file, other changes 2025-09-21 16:35:14 +02:00
Saumya c065ed5b1b move billing and admin to core 2025-09-19 10:30:43 +05:30