
jason.woltjeandClaude Sonnet 4.5
68f641211a
fix(#195): Implement RLS context helpers consistently across all services
Added workspace context management to PrismaService:
- setWorkspaceContext(userId, workspaceId, client?) - Sets session variables
- clearWorkspaceContext(client?) - Clears session variables
- withWorkspaceContext(userId, workspaceId, fn) - Transaction wrapper
Extended db-context.ts with workspace-scoped helpers:
- setCurrentWorkspace(workspaceId, client)
- setWorkspaceContext(userId, workspaceId, client)
- clearWorkspaceContext(client)
- withWorkspaceContext(userId, workspaceId, fn)
All functions use SET LOCAL for transaction-scoped variables (connection pool safe).
Added comprehensive tests (11 passing unit tests).
Fixes #195
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
2026-02-03 22:44:54 -06:00
..
2026-02-03 14:37:06 -06:00
2026-02-03 14:37:06 -06:00
2026-02-03 22:29:42 -06:00
2026-01-31 16:50:32 -06:00
2026-02-03 14:37:06 -06:00
2026-02-01 21:01:25 -06:00
2026-02-03 22:38:13 -06:00
2026-01-31 13:44:23 -06:00
2026-01-31 13:51:46 -06:00
2026-02-04 03:08:09 +00:00
2026-02-03 14:37:06 -06:00
2026-01-30 18:26:41 -06:00
2026-02-03 14:37:06 -06:00
2026-02-03 14:37:06 -06:00
2026-02-03 22:07:55 -06:00
2026-01-28 15:07:04 -06:00
2026-02-03 14:37:06 -06:00
2026-02-02 12:51:17 -06:00
2026-02-02 12:30:19 -06:00
2026-02-02 11:41:11 -06:00
2026-02-03 14:37:06 -06:00
2026-02-03 14:37:06 -06:00
2026-02-03 22:44:54 -06:00
2026-01-31 15:01:18 -06:00
2026-01-31 13:07:58 -06:00
2026-02-03 14:37:06 -06:00
2026-01-31 12:44:50 -06:00
2026-02-03 22:44:54 -06:00
2026-02-03 14:37:06 -06:00
2026-01-31 13:33:04 -06:00
2026-01-31 14:47:59 -06:00
2026-01-31 14:01:42 -06:00
2026-02-04 03:08:09 +00:00
2026-02-03 14:37:06 -06:00
2026-02-03 14:37:06 -06:00
2026-01-31 12:55:11 -06:00
2026-01-31 15:01:18 -06:00
2026-01-30 18:26:41 -06:00
2026-02-03 14:37:06 -06:00
2026-02-03 14:37:06 -06:00
2026-02-03 19:17:13 -06:00
2026-02-01 01:48:09 -06:00
2026-01-28 16:24:25 -06:00
2026-01-30 18:26:41 -06:00
2026-02-03 20:35:00 -06:00
2026-01-28 13:31:33 -06:00
2026-02-02 12:13:17 -06:00
2026-02-03 22:29:42 -06:00