You will build a tasks table where each person sees only their own tasks.

1. Create the table in Studio

  1. Open your project and choose the development environment from the top bar.
  2. In the sidebar, under Data, choose Data. This is the table editor.
  3. In its secondary sidebar click Create table. A sheet slides in.
  4. Details: set Name to tasks. Leave the other fields as they are.
  5. Columns: click Add column three times and fill in:
  6. Behaviour: set Owner field to owner_id (filled with the caller’s user id on create).
  7. Access: under Quick access set choose Each user sees and changes their own records.
  8. Click Save changes.
The table is created in the database and appears in the sidebar, tagged resource. Click it to open the table editor with its Data, Columns, Access, Indexes, History and Settings tabs.

2. Add a row by hand

Open the Data tab and click Add row. Give it a title. Leave owner_id empty for now. Studio acts with its own authority, so you can see every row, whoever owns it.

3. Use it from your app

Sign a person in (see Auth), then:
The row you added by hand in step 2 does not appear in this list: it has no owner, so the owner rule doesn’t match it. That is the rule working.

4. Prove it with a second person

Create a second test user (Users & auth → Users → New user), sign in as them, and list tasks. They get none of the first person’s tasks.

5. See the requests

Open Project → Activity and find the requests from your app. Open one to see who made it, what it returned, and which rule decided.

What you have now

  • A table, an API for it, and per-person access rules.
  • A development copy you can change freely. When you’re ready, promote the definition to production.

Tables and resources

The Create table sheet in full.

Columns and types

Everything a column can be.