Row-Level Security (RLS) policies #10

Closed
opened 2026-01-28 19:03:38 +00:00 by jason.woltje · 0 comments
Owner

Implement PostgreSQL RLS for workspace isolation.

Policies needed:

  • tasks: Users can only see/modify tasks in their workspaces
  • events: Users can only see/modify events in their workspaces
  • projects: Users can only see/modify projects in their workspaces
  • activity_log: Users can only see activity in their workspaces

Implementation:

  • Enable RLS on all workspace-scoped tables
  • Create policies based on workspace_id
  • Set current_user context in session
  • Test isolation between workspaces

Requirements:

  • Zero data leakage between workspaces
  • Performance acceptable (index workspace_id)
  • Works with Prisma
Implement PostgreSQL RLS for workspace isolation. **Policies needed:** - tasks: Users can only see/modify tasks in their workspaces - events: Users can only see/modify events in their workspaces - projects: Users can only see/modify projects in their workspaces - activity_log: Users can only see activity in their workspaces **Implementation:** - Enable RLS on all workspace-scoped tables - Create policies based on workspace_id - Set current_user context in session - Test isolation between workspaces **Requirements:** - Zero data leakage between workspaces - Performance acceptable (index workspace_id) - Works with Prisma
jason.woltje added this to the M2-MultiTenant (0.0.2) milestone 2026-01-28 19:03:38 +00:00
jason.woltje added the databasesecurityp0 labels 2026-01-28 19:03:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#10