Files
alpenwerk-hr/db/migrations/20260714120500_default_grants.sql
muena 3ea1765850 Übergabestand 2026-10-14
Anmeldung ausschliesslich ueber Microsoft Entra ID; HR-Zugang wird mit
freischalten.ps1 vergeben und entzogen (mit Eintrag im Audit-Log).

Startpasswort des LOLYO-Exports kommt aus LOLYO_STARTPASSWORT.
Content-Security-Policy wird durchgesetzt.
Sicherheitskonzept in docs/sicherheitskonzept.md; Lesezugriff fuer die IT
und Abnahme-Checkliste in deploy/windows/README.md.

Stand: d136da0
2026-10-14 09:46:52 +02:00

22 lines
1.3 KiB
SQL

-- Explicit schema/table/sequence/routine grants for anon/authenticated/
-- service_role.
--
-- Every table in this schema relies on RLS policies to restrict access, but
-- RLS only ever *narrows* what an already-GRANTed role may do — Postgres
-- still checks ordinary object privileges first, independent of a role's
-- BYPASSRLS flag. Some hosting platforms apply these grants automatically
-- during provisioning; a *fresh* Postgres (a new local dev instance, a
-- disaster-recovery restore, or CI) does not, and the migrations would fail
-- there with "permission denied for table X" even for the service role.
-- Making the grants explicit here makes the schema fully self-contained and
-- reprovisionable from scratch.
grant usage on schema public to anon, authenticated, service_role;
grant all on all tables in schema public to anon, authenticated, service_role;
grant all on all sequences in schema public to anon, authenticated, service_role;
grant all on all routines in schema public to anon, authenticated, service_role;
alter default privileges in schema public grant all on tables to anon, authenticated, service_role;
alter default privileges in schema public grant all on sequences to anon, authenticated, service_role;
alter default privileges in schema public grant all on routines to anon, authenticated, service_role;