feat(auth): merge reporter, supervisor, capa_owner into ssa role
Add Site Safety Assistant (ssa) role replacing reporter, supervisor and capa_owner. Portals move under /ssa (overview, my-reports, incidents, capas). Update RLS, schema, API role checks, notification recipients, nav and tests. Add db/ops/2026-11-06-merge-roles-into-ssa.sql (not yet applied; needs owner go-ahead and a pg_dump first). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
701fefd286
commit
813395700f
@@ -38,7 +38,7 @@ function req(note: string | null, fileCount: number) {
|
||||
const ctx = { params: Promise.resolve({ id: 'capa-1' }) }
|
||||
|
||||
beforeEach(() => {
|
||||
h.session = { sub: 'owner-1', role: 'capa_owner' }
|
||||
h.session = { sub: 'owner-1', role: 'ssa' }
|
||||
h.capa = { incidentId: 'inc-1', ownerUserId: 'owner-1', status: 'in_progress' }
|
||||
h.updates = []
|
||||
h.inserts = []
|
||||
@@ -56,7 +56,7 @@ describe('POST /api/capa/[id]/submit', () => {
|
||||
expect((await POST(req('done', 1) as never, ctx)).status).toBe(404)
|
||||
})
|
||||
it('403 for a user who is neither owner nor hse/admin', async () => {
|
||||
h.session = { sub: 'other', role: 'reporter' }
|
||||
h.session = { sub: 'other', role: 'ssa' }
|
||||
expect((await POST(req('done', 1) as never, ctx)).status).toBe(403)
|
||||
})
|
||||
it('409 when status is not in_progress', async () => {
|
||||
|
||||
Reference in New Issue
Block a user