mirror of
https://github.com/temetro/temetro.git
synced 2026-08-10 02:29:58 +00:00
e37d131800
Drop the unused read-only "viewer" role and remap any members (and pending invitations) holding it to "member" via a custom migration. Add a "lab" statement (read/write) granted to all full clinicians, plus two new provisionable department roles: "pharmacy" (patient/appointment read, prescription read+write — no delete, which doubles as the full-clinician marker the frontend probes) and "lab" (patient/appointment read, task queue, lab results via the new statement). Both join TASK_DEPARTMENTS so tasks can be assigned to them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
9 lines
484 B
SQL
9 lines
484 B
SQL
-- Custom SQL migration file, put your code below! --
|
|
|
|
-- The read-only `viewer` role was removed from src/lib/access.ts. Members left
|
|
-- with it would fail every permission check (requirePermission looks roles up
|
|
-- by name), so remap them to `member` (clinician). Pending invitations carry a
|
|
-- role too — cover them as well.
|
|
UPDATE "member" SET "role" = 'member' WHERE "role" = 'viewer';--> statement-breakpoint
|
|
UPDATE "invitation" SET "role" = 'member' WHERE "role" = 'viewer';
|