1
0
Fork 0
Commit Graph

6 Commits

Author SHA1 Message Date
Jonny 2acaaced93 feat: Firmen, firma_id in allen Fachtabellen, Trigger und Eindeutigkeit pro Firma
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-12 09:39:23 +02:00
Jonny 306ce1544d fix: pgTAP-Luecke (Fahrer-Grenze) und veraltete Spec-Stelle nach Final-Review
- profiles_rls_test.sql: fehlende negative Assertion ergaenzt, die
  sicherstellt, dass der Fahrer-Testnutzer 44444444... weiterhin KEIN
  Readonly-Profil sieht (Policy bleibt scharf auf role in
  ('admin','disponent') begrenzt). plan(12) -> plan(13).
- design.md: Aussage zu erstellt_von im Auftrag-Typ korrigiert (nullable
  statt immer vorhanden), passend zum bereits umgesetzten Code und zum
  Nachtrag in Abschnitt 1 der gleichen Spec.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-19 11:06:54 +02:00
Jonny 038e2e422b feat: Fahrer/Readonly sehen Admin- und Disponent-Profile (RLS)
Neue Policy fuer Ersteller-Anzeige im Auftrag (Task 2/3 folgen). Bestehende
Assertion "Fahrer sieht nur das eigene Profil" testete eine Einschraenkung,
die dieses Feature bewusst aufhebt -- Erwartungswert und Titel angepasst,
statt der Policy, auf Anweisung des Plan-Autors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HCHRPWuV3bd37NJhW2NK6P
2026-08-19 10:24:36 +02:00
Jonny bb9ac2afe6 feat: allow disponent to see fahrer profiles for Kanban assignment 2026-07-07 15:35:40 +02:00
Jonny d03052ca73 test: cover profiles UPDATE RLS boundary and privilege-escalation trigger
Final review found the RLS test suite only covered SELECT, never the
actual security-relevant path: a non-admin changing a profile's role.
Add pgTAP coverage for a fahrer's own-role UPDATE being blocked by RLS
(0 rows affected, role unchanged), the positive admin-can-update-others
case, and a regression test for handle_new_user() ignoring
raw_user_meta_data.role so a future edit reintroducing that read fails
loudly instead of quietly reopening the escalation hole.

Also add a migration giving the admin UPDATE policy an explicit
WITH CHECK (behavior unchanged, since Postgres already falls back to
USING for UPDATE policies without one) to document the pattern for
future sub-projects copying this RLS setup.
2026-07-05 00:45:27 +02:00
Jonny d13994b386 feat: add RLS policies and pgTAP tests for profiles 2026-07-04 11:58:09 +02:00