Skip to content
FR
Back

immo-grant

Real-estate listings whose real subject is authorisation: every access rule lives in the PostgreSQL schema.

Public projectSvelteKit, TypeScript, Supabase, PostgreSQL, RLS, PL/pgSQL, Vitest, Playwright

The problem

An access rule written in the application can be bypassed as soon as another client talks to the database. Delegated mandates, which expire, are where that leak costs the most.

The approach

Every rule is declared in the schema as an RLS policy: none is reimplemented in the application. Recursion between policies goes through a SECURITY DEFINER function, and what WITH CHECK cannot express goes through column privileges.

The proof

A 24-cell authorisation matrix, each cell covered by a named test, run against the schema as applied in an in-process PostgreSQL (PGlite), without containers or external services.

The immo-grant demo home page
Authorisation lives in the schema
RolesActionsMatrix24 cellsRLS policiesin PostgreSQL24 named testsapplied schemadeclaresrun against