1
0
Fork 0
fahrPool/supabase/migrations
Jonny 58e34a14a6 fix: close stornieren RLS gap and harden fahrtBeenden/stornieren
Security review (automated scan + Task 11 reviewer) found a fahrer could
storniere their own assigned order because Task 2's fahrer UPDATE policy
only constrains zugewiesen_an, never status. Adds a role-gated check to
the status trigger (only admin/disponent may set status='storniert') plus
a pgTAP regression test. Also hardens fahrtBeenden/stornieren to check
affected-row counts instead of silently redirecting to a success page on
a blocked update.

Live-verified: fahrer storno attempt now rejected by the trigger; normal
fahrer fahrtBeenden flow unaffected. db reset + test db (21/21), build,
and npm test (17/17) all pass.
2026-07-06 06:22:53 +02:00
..
20260704092843_profiles.sql fix: never derive new user role from raw_user_meta_data (privilege escalation) 2026-07-04 11:48:26 +02:00
20260704095119_rls_profiles.sql feat: add RLS policies and pgTAP tests for profiles 2026-07-04 11:58:09 +02:00
20260704224211_add_profiles_update_with_check.sql test: cover profiles UPDATE RLS boundary and privilege-escalation trigger 2026-07-05 00:45:27 +02:00
20260705085814_orte_fahrzeuge.sql feat: add orte and fahrzeuge lookup tables with RLS 2026-07-05 10:59:55 +02:00
20260705090655_auftraege.sql fix: gate auftraege RLS policies on user_role() to close readonly claim gap 2026-07-05 11:27:27 +02:00
20260705144530_auftrag_fotos.sql feat: add auftrag_fotos table with RLS and required-photo constraint 2026-07-05 16:47:26 +02:00
20260705145543_auftrag_status_trigger.sql fix: close stornieren RLS gap and harden fahrtBeenden/stornieren 2026-07-06 06:22:53 +02:00
20260705150911_auftrag_fotos_bucket.sql feat: add auftrag-fotos storage bucket with RLS policies 2026-07-05 17:12:18 +02:00