The condition builder is how you make custom rules in Studio. You add rules (single checks) and groups (sets of checks), and choose how they combine. You never type a rule’s structure.
Condition builder with All of these rules pass, Is signed in yes, and Owns the record user_id

The builder in the New policy sheet.

Where

It appears in Access → Policies → New policy (under Who passes), and inline wherever you choose Custom condition in a rule picker (a table’s Access tab, a bucket, a channel, a route, a subscription’s Only when…).

Groups: how checks combine

At the top of a group, pick one: Click + Group to nest: “signed in and (the owner or an admin)” is an All of containing an Any of. An empty All of says No rules: everyone passes; an empty Any of says No rules: nobody passes.

Kinds of check

Click + Rule, then open the first menu:
Menu listing Is signed in, Has role, Has permission, Owns the record (field), Uses a secret key, Signed in with 2FA, Key has scope, Caller kind is, Compare values, Check a value, Nobody

The kinds of check.

Compare values

Choose the Comparison operator:

Check a value

exists (it is present), is set / true (present and not empty or false), is empty (missing or empty).

The values you type

Each side of a comparison is either a path (it starts with $ and reads a fact about the request) or a plain value:
  • $auth.user_id is the caller’s id; $record.owner_id is a column on the record; $input.status is something being submitted.
  • draft, 3, yes are plain values. Write $$ for a literal dollar sign.
The box suggests the common paths as you type. See Facts a rule can check.

Build one: “the owner or an admin, but only while not locked”

  1. Open New policy. Leave All of selected.
  2. Click + Group, switch it to Any of.
    • In the group, + Rule → Owns the record (field) → owner_id.
    • + Rule → Has role → admin.
  3. Back in the outer All of, + Rule → Compare values…: $record.locked does not equal true.
  4. Name it owner_or_admin_unlocked. Create policy.
Read back as a sentence: All of these pass: (any of: owns the record, has role admin) and locked is not true.

Tips

  • Prefer the dedicated kinds (Has role, Owns the record) to comparisons you make yourself: they read better and Pawabase can turn them into database filters.
  • Keep groups shallow. More than three levels? Split into named rules (Named rules).
  • Use Use example on the New policy sheet to see a working rule.

Operators

Every comparison.

Recipes

Rules to copy.