Implement RLS context helpers consistently across all services #195
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
RLS context helpers exist (db-context.ts) but are not used by services. Security relies on manual workspace filtering everywhere. If RLS policies are enabled, queries will fail. If they aren't, one missed filter becomes a cross-tenant data leak.
Locations
Questions (URGENT - Need Answers)
Risk
If RLS policies are enabled without withUserContext:
If RLS policies are NOT enabled:
Acceptance Criteria
Option A: Prisma Middleware (Recommended)
Option B: Request-scoped Prisma
Testing
References
External security review findings (2026-02-02)