pg_permissions
pg_permissions stores roles, sharing relationships and Cedar policies alongside your application data. Your backend can ask Postgres who can do what without calling a separate authorization service. If you want the database to enforce the same rules on a table, use row level security (RLS).
Check access from your backend
Section titled “Check access from your backend”Can Alice read documents in Acme? With a server client, set the subject and ask for the permission in that organization. The quickstart walks through assigning the role and checking two users.
const { data: allowed, error } = await permissions .as({ id: 'alice' }) .rbac.hasPermission({ permission: 'documents.read', scope: 'acme' })
if (error) throw errorif (!allowed) throw new Error('Forbidden')begin;select set_config('permissions.subject_id', 'alice', true);select permissions.rbac_has_permission( permission => 'documents.read', scope => 'acme');commit;Start with your access rules
Section titled “Start with your access rules”Connect to Postgres
Section titled “Connect to Postgres”Install the extension in Postgres 16, 17 or 18, then connect your application. The overview explains why we built it and how each model fits into an application.
API reference
Section titled “API reference”Look up a method in the JavaScript client reference, or browse the shared, RBAC, OpenFGA and Cedar APIs.
OpenFGA compatibility, Cedar compatibility, API limits, and CEL support describe the boundaries of the implementation. A check returns a decision for your backend to enforce. If you add RLS, standalone checks do not include any extra rules defined only in those table policies.
Design and evidence
Section titled “Design and evidence”The architecture guide explains how the three models share identity while keeping their rules separate. The Cedar design record describes how we compare decisions against Cedar’s own tests.
For latency and throughput measurements, see the benchmarks. Each workload includes the data size and test conditions.
For agents and other tools, the Markdown index links to plain-text versions of the documentation, including every language example.