Operation Permissions
Every permission an operation may declare. An operation’s grants are what its endpoint may do when it calls back into Foir: the token the operation is called with carries them.
A permission is written <resource>:<verb>. A reach after the verb says whose rows it is for. With none, a permission about records or files is for the operation’s own: the project’s, or those of the user a run acts for. .named is the ones the operation names, and .all is every owner’s in the project. A model after a second colon is the model a record permission is for. Reading and writing records may name one field of a model, as <model>.<field> (records:write:order.status): that is how a field the model guards is given, and a grant on the model alone does not reach it. See Guarded fields.
Each permission stands for itself. Changing a record and creating one are two permissions, so an operation that does both declares both.
The platform refuses any permission that is not on this list, and says why. An operation holds no wildcard: it names each permission it declares.
What an operation may declare
An app’s manifest declares from part of this list, marked in the last column. Whoever installs the app is shown that list and approves it.
| Permission | What it does | In an app’s manifest |
|---|---|---|
appconfig:read | Read the configuration of the app an operation belongs to. | Yes |
appsecrets:delete | Delete an app’s secrets. | Yes |
appsecrets:list | List the names of an app’s secrets. | Yes |
appsecrets:put | Set and rotate an app’s secrets. | Yes |
appsecrets:read | Read an app’s secrets. | Yes |
embeddings:read | Search records by meaning, and read a record’s embeddings. | No |
embeddings:write | Write and delete a record’s embeddings. | No |
files:delete | Delete and restore files. | Yes |
files:delete.all | Delete and restore files. For every one in the project. | Yes |
files:read | Read and list files. | Yes |
files:read.all | Read and list files. For every one in the project. | Yes |
files:write | Upload files and edit their details. | Yes |
files:write.all | Upload files and edit their details. For every one in the project. | Yes |
identities:delete | Remove an identity an app names at its own system, and the account when nothing else is theirs. | Yes |
identities:read | Find which user holds an identity at an app’s own system. | Yes |
notifications:consent | Set the notification preference of a user the caller names, in a category the project makes opt-in. | Yes |
notifications:read | Read notifications and notification preferences. | Yes |
notifications:write.named | Send notifications, register devices, and set preferences. For the ones the operation names. | Yes |
operations:complete | Report an execution’s progress and its result. | Yes |
organizations:create | Create an organisation, with its first member and what it is provisioned with. | Yes |
organizations:delete | Schedule an organisation’s deletion, with everything beneath it. It is removed when the retention window closes, unless it is resumed first. | Yes |
project:stand | Act as the project: reach the project’s own records, files and notes, the ones no person owns. | Yes |
records:attribute | Name the user a record belongs to when it is created, and hand it to another owner later. | No |
records:attribute:<model> | Name the user a record belongs to when it is created, and hand it to another owner later. For the one model it names. | Yes |
records:create:<model> | Create records. For the one model it names. | Yes |
records:delete.all:<model> | Delete records. For every one in the project. For the one model it names. | Yes |
records:delete:<model> | Delete records. For the one model it names. | Yes |
records:publish.all:<model> | Publish and unpublish record versions. For every one in the project. For the one model it names. | Yes |
records:publish:<model> | Publish and unpublish record versions. For the one model it names. | Yes |
records:read.all:<model> | Read records. For every one in the project. For the one model it names. | Yes |
records:read:<model> | Read records. For the one model it names. | Yes |
records:write.all:<model> | Change records: update, duplicate, revert, and share them. For every one in the project. For the one model it names. | Yes |
records:write:<model> | Change records: update, duplicate, revert, and share them. For the one model it names. | Yes |
secrets:read | Read the project’s secrets. | No |
status:write | Report an app’s status from an execution. | Yes |
targeting:debug | Explain why a variant was chosen for a request. | No |
users:create | Create a user. | Yes |
users:read.all | Read users’ accounts. For every one in the project. | Yes |
users:read.named | Read users’ accounts. For the ones the operation names. | Yes |
usersecrets:delete | Delete a user’s secret. | No |
usersecrets:list | List a user’s secrets. | No |
usersecrets:put | Store a user’s secret. | No |
usersecrets:read | Read a user’s secrets. | No |
What a token carries that no operation declared
The token an operation is called with carries what the operation declares and nothing else. An operation that reads a secret declares the read: appsecrets:read for an operation an app or a config owns, which reads that owner’s secrets and no other’s, and secrets:read for one the project owns.
Two tokens carry one thing more:
- A token for a run’s callback carries
operations:complete, for that run alone. - The token an app’s inbound webhook is forwarded with carries what the app’s operations declare between them, and
appsecrets:read. The app verifies a delivery with a secret of its own, so an app that receives webhooks reads its own secrets.
Who may give an operation a grant
Nobody gives an operation what they do not hold themselves. Whoever writes a grant onto an operation holds it: by the operation’s own verbs, by a push, and where an app is installed, updated or mapped to a model. An edit is asked for what it adds. operations:complete and status:write are not asked for, because only a run holds them.