forked from fahrPool/fahrPool
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. |
||
|---|---|---|
| docs/superpowers | ||
| scripts | ||
| supabase | ||
| volumes | ||
| web | ||
| .env.example | ||
| .gitignore | ||
| CLAUDE.md | ||
| docker-compose.yaml | ||