zite.permissions.json file at the workspace root.
This is the schema reference; for the concepts and evaluation model, see Roles & permissions.
Structure
Fields
version: always"1.0".defaultPolicy:"deny"to enforce the file. See the warning above.roles: your custom roles, each with a stableidand a displayname. Rules reference roles byid, so renaming a role never invalidates a rule or a member’s assignment. Do not list the built-in roles here (see below).tables: keyed by the table’s PascalCase SDK name, the string the generated client passes tocreateTableClientin.zite/db.ts("Orders", not"orders"). Each entry has arulesarray.
Built-in roles
Two roles exist on every workspace. They are virtual: reference their ids in rules, but never list them in theroles array. An entry carrying a built-in id and its exact name is stripped when the file
is read, and a built-in id under any other name is rejected outright as a squat.
builtin:all-users does not mean “signed in”. To require a session, set authenticated: true on the
workflow or add a rowFilter on a userField.
Rules
Each rule is one role, one operation, and one optional filter. To grant a role several operations, write one rule per operation.roleId: the id of a custom role, or a built-in id.operation: one ofread,create,update,delete.rowFilter: restricts which rows the rule covers (like a PostgresUSINGclause).
rowFilter does not apply to create. A create rule grants the operation outright, so enforce any
constraint on new rows in your workflow.Row filters
A comparison filter compares a recordfield to either a value from the signed-in user (userField) or a
fixed staticValue (exactly one of the two) using eq, neq, contains, gt, gte, lt, or
lte. Compose comparisons with and, or, and not.
userField can reference the base user fields (id, email, firstName, lastName) plus any fields
synced from your users table.
Example
defaultPolicy is deny, any table without rules is fully locked down.
Permissions are table- and row-level and govern the workspace database. There are no field-level
permissions. Rules apply to internal and external apps alike. See
Roles & permissions.