Skip to main content
Fine-grained permissions let you control access at the table and action level. They work with both CLI-generated tokens and JWKS-issued tokens.

Permission Format

Permissions follow the format <table-name|all>:<action1>,<action2>:
Permission rules only grant access. There are no deny rules. Use all as the table name to apply permissions to every table.

Available Actions

data_read is allowed on SQLite system tables (e.g., sqlite_master, sqlite_schema) by default, allowing users to query database metadata.
data_add also allows replacing existing rows through INSERT OR REPLACE or REPLACE INTO.

Schema Actions

Each schema statement needs a schema action on a specific table name:

Example

This token can read all tables. It can change posts with ALTER TABLE, and create or drop indexes and triggers on posts. It cannot drop the posts table, because it does not have data_delete on posts:

Role-Based Access Example

You can configure your JWT template to grant different permissions based on user roles: With JWKS, these permissions are embedded in the JWT token based on user metadata (e.g., role, group membership) from your auth provider.