Skip to main content

D4 — RLS roles

Architecture decision record, relocated verbatim from the retired single-file docs/tenancy/ decision log. Status, thematic clusters, and how to record a new ADR: the decision log index.

  • Central role = the existing app role (stables locally) — keeps BYPASSRLS, owns the schema, runs migrations and php artisan tenants:rls.
  • RLS role = dedicated login role with NOBYPASSRLS, used only inside tenant context.
    • Username/password via TENANCY_RLS_USERNAME / TENANCY_RLS_PASSWORD.
    • Local default: stables_rls.
  • Local dev: provisioned by a Postgres init script (fresh volumes) + a make target for existing volumes. Prod/staging: provisioned via stables-core-infra (out of this repo).

← Decision log index