Skip to content

Conversation

@MODSetter
Copy link
Owner

@MODSetter MODSetter commented Jan 20, 2026

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR simplifies the RBAC (Role-Based Access Control) system by removing the Admin role and keeping only three roles: Owner, Editor, and Viewer. The Admin role has been consolidated into Editor with reduced permissions (no delete, role management, or settings updates). A database migration handles the transition by moving existing Admin users to the Editor role and updating permission sets for all system roles. The frontend team management UI has been updated to reflect the new three-role system, including permission presets for quick role creation. Additionally, chat thread access control logic has been refactored to properly enforce ownership requirements for sensitive operations like changing visibility.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/app/db.py
2 surfsense_backend/alembic/versions/72_simplify_rbac_roles.py
3 surfsense_backend/app/routes/new_chat_routes.py
4 surfsense_web/app/dashboard/[search_space_id]/team/page.tsx
5 surfsense_backend/app/agents/new_chat/tools/mcp_client.py
⚠️ Inconsistent Changes Detected
File Path Warning
surfsense_backend/app/agents/new_chat/tools/mcp_client.py This file contains only a formatting change (removing line breaks in a logger statement) which is unrelated to the RBAC role simplification described in the PR

Need help? Join our Discord

Analyze latest changes

- Removed the Admin role and updated the permission sets for Owner, Editor, and Viewer roles in db.py.
- Clarified access requirements for chat threads in new_chat_routes.py, ensuring ownership checks are prioritized.
- Added preset permission options for quick role creation in the CreateRoleDialog component of the team page.
@vercel
Copy link

vercel bot commented Jan 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
surf-sense-frontend Ready Ready Preview, Comment Jan 20, 2026 11:00am

Request Review

@MODSetter MODSetter merged commit 03ebd41 into main Jan 20, 2026
4 of 6 checks passed
Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 43eb1cc..e578bb9

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (5)

surfsense_backend/alembic/versions/72_simplify_rbac_roles.py
surfsense_backend/app/agents/new_chat/tools/mcp_client.py
surfsense_backend/app/db.py
surfsense_backend/app/routes/new_chat_routes.py
surfsense_web/app/dashboard/[search_space_id]/team/page.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants