OpenThink Cloud

Write table policies

Rules that decide which rows each person can read, add, change and delete.

A table policy is a list of rules on one table, in the spirit of Row Level Security in Postgres or Security Rules in Firebase. Each rule is a condition on the row itself.

json
[
  { "action": "select", "using": "true" },
  { "action": "insert", "check": "row.by == me" },
  { "action": "update", "using": "row.by == me" },
  { "action": "update", "using": "me in row.Assignee", "columns": ["Status"] },
  { "action": "delete", "using": "row.by == me" }
]

Members see every task, add their own, edit and delete what they created, and the assignee can change only the Status column.

Who is subject to policies

Owners and editors are not limited: they build the table. Policies apply to people with the view or comment role, link visitors and guests. To have someone work under the rules, invite them with the view role on the table, folder or project, then write rules that let them write.

Rule fields

FieldMeaning
actionselect, insert, update or delete.
appliesToWho the rule applies to, joined with |: members (has a role on the table and is signed in; default), public (anyone who can open the table, including guests), owner, edit, comment, view.
usingCondition the existing row must meet (select, update, delete). Empty means every row.
checkCondition the row after the write must meet (insert, update). On update, empty means the same as using.
columnsColumns that may be read (select) or changed (update), by name. Empty means every column.

How rules combine

  • Rules of the same action are OR-ed. If no rule applies to a person, they cannot perform the action.
  • An update is allowed when one update rule matches the old row in using, every changed column is in its columns, and the new row passes check.
  • Readable columns are the union of columns of the select rules that apply. Other columns are removed from rows and from the column list.
  • insert has no using; select and delete have no check; columns exists only on select and update.

Presets

Instead of an array, a policy can be the name of a preset:

PresetRules
ownselect public row.by == me · insert members check row.by == me · update, delete members row.by == me
read_all_ownSame as own, but select is true.
appendinsert members check row.by == me.

Setting the policy to null removes the table's own rules, and the row roles chosen in the Share dialog apply again.

Validation

  • A rule with a wrong column name, type, option or syntax is rejected with the rule number, the field and the character position. The previous rules stay in place.
  • Up to 20 rules per table. A condition is at most 1,000 characters, 200 nodes and 30 levels deep; lists hold up to 50 items.
  • Renaming a column makes rules that use the old name invalid. Invalid rules are skipped when applied, so access only narrows. Save the rules again with the new name.

Tables with policies are closed

A page that embeds the table, or an HTML page that names it, does not grant access. Readers need a role on the table itself (invite, folder, project or link), and then the policy applies.

Last updated 2026-12-03 UTC. Something wrong or missing? Send feedback.