Security & sharing
Roles and security
Build → Security decides what the people using your app may see and do. Owners and editors are never limited by it: these rules are for users.
#Roles
Roles are what people do in this app, like Dispatcher, Technician or Customer. You create them here and give them to groups on the Sharing page. Someone can hold several roles.
- Deleting a role removes it from every group and rule. It can't be deleted while an expression still uses it.
- Use roles in any expression:
HASROLE("Dispatcher"),USERROLES().
#Per table: who can do what
For each table, choose who can see, add, edit and delete its records: everyone with access, only some roles, or nobody.
Add, edit and delete can also have an Only if condition on the record:
| Action | Only if | Means |
|---|---|---|
| edit | NOT([Locked]) |
locked records can't be changed |
| edit | [Status] <> "Invoiced" |
invoiced orders are final |
| delete | [Created by] = USEREMAIL() |
people delete only what they added |
#Which records people see
Each table has a row filter:
- Every record (the default);
- Their own records: pick the field that holds the owner (a person, an email or Created by field), so each person sees the records they own;
- Records matching an expression, for example
OR([Region] = "North", HASROLE("Dispatcher")).
Roles you tick as bypass see every record anyway, for example Manager.
Row filters apply everywhere: in views, in links and pickers, in expressions like FILTER
and SELECT, in exports, in the in-app assistant and in the REST API.
#Views
Each view can be limited to some roles. Views people may not open are left out of their menu, and opening one by link shows "not found". A view also needs its table to be visible to them.
#Check what people see
In the builder's preview, View as shows the app the way someone with one role (or with no role) sees it: the menu, the views and the records.
#The security advisor
Build → Security has an advisor that points at rules that may be too open or that broke, for example:
- a table with an owner field whose records everyone can see;
- delete or edit open to everyone;
- a rule whose expression no longer works;
- roles that nothing uses.
#How it's enforced
Rules are checked on the server for every request and every record, not just hidden in the interface, and each app's data is kept apart from every other app's. API keys and automations started by an API call act as a person and get exactly that person's rules.