Skip to content
MyAppBuilder
StableGuide

Roles

A role is a label on an app user that your permission rules refer to. Every app starts with six built-in roles, and you can add your own. Roles belong to the app and its users; they are not the same as the workspace roles of your builder team.

Roles

A role is a label on an app user that your permission rules refer to. Every app starts with six built-in roles, and you can add your own. Roles belong to the app and its users; they are not the same as the workspace roles of your builder team.

The built-in roles

RoleDefault data accessTypical use
OwnerFull accessThe business owner
AdminFull accessManagers
StaffView, create, edit, delete all recordsEmployees, technicians
ViewerView all recordsRead-only colleagues, accountants
CustomerNone until you grant itPortal users; usually "own records only"
PublicNone until you grant itVisitors who are not signed in

Full access roles (Owner, Admin, and any custom role with the Full access checkbox) can open every page, see every component and read, create, edit and delete every record and field. They cannot be chosen as the role for new sign-ups.

Public is special: it stands for visitors without an account. It cannot be assigned to a user, and because such visitors have no identity, its rules can only cover all records or none — never "own records".

When to create a custom role

  • A group with different rights than Staff: Technician (edit jobs, no customers), Accountant (view invoices), Partner.
  • You want permissions that are easy to explain by job title.

Custom roles start with no access to any entity; grant access in the data permissions matrix.

How to create a role

  1. Open Users → Roles & permissions.
  2. Click New role.
  3. Enter a name (shown in the app) and an optional description. The role also gets a stable id, shown under the name as you type (role_technician for Technician; _2 is added when it is taken). The id never changes, even when you rename the role — conditions and workflow role checks use it (Current user › roleId, see below). It is the same id an app plan's customRoles entry with that key gets.
  4. Tick Full access to every page, record and field only for administrator-type roles.
  5. Tick External for people outside your team: suppliers, partners, portal users. (Beta.) External roles are left out of Team roles (the shortcut in Page access) and of plan pages with audience: "team". External changes no access by itself.
  6. Click create. The role appears as a card with the badges Custom and, if applicable, Full access or External, and its id; the card marked New sign-ups is the current default role.
  7. Give users the role in Users → App users (the Role dropdown on each user), or make it the Role for new sign-ups in Users → Sign-in.

Role cards also let you rename a role (click the name; the id stays the same), edit its description (click the line under it), toggle Full access and (custom roles) External, and delete custom roles.

Deleting a role first shows what it affects, found by the role's id: pages and components limited to it (when it is their only role, they become open to every signed-in user, or to everyone on the page; pick other roles first), access rules that are removed, other roles' record rules (filters and lookup rules), workflow steps and visibility rules that mention the id (they are kept but no longer match anyone), and whether it is the role for new sign-ups (the default moves to Customer).

Where roles are used

  • Data permissions matrix columns (Entity permissions).
  • Page access checkboxes (Page permissions); Team roles ticks the built-in team roles and every custom role that isn't external.
  • Component Permissions tab (Component permissions).
  • Conditions and templates: Current user › roleId — the stable id (role_owner, role_admin, role_staff, role_viewer, role_customer, role_public, or the id of a custom role, e.g. role_technician for a role an app plan declares in customRoles). Current user › role / {{user.role}} is the display name — fine for showing, not for checks.
  • Workflow role checks: If {{user.roleId}} not in role_owner,role_admin,role_dispatcher → Stop (see Workflow steps › Role checks). In any condition editor, Add role check builds it for you: Current user's role is (not) one of plus a checkbox per role. It stores role ids, never names.
  • Preview as in the builder to see the app as any role.

Builder workspace roles are different

Your builder team has workspace roles viewer / editor / admin / owner that control who can edit the project, manage secrets, publish, or manage live data and app users. They have nothing to do with app roles; a builder editor is not an app Staff user. See Builder team in the Users section.

Common mistakes

  • Using Owner/Admin for customers "to make it work": they see everything.
  • Expecting Public to have "own records". Not possible; use sign-in for anything personal.
  • Checking the role name instead of the role id. A condition on Current user › role compares the display name and silently stops matching when someone renames the role; compare Current user › roleId instead (ids never change).
  • Expecting a new custom role to see data. Custom roles start with no access to any table; grant it in the Data permissions matrix.
  • Deleting a role with users. Those users fall back to the sign-up default role when they next sign in; reassign them first.

Advanced

Roles are { id, name, description?, builtin?, isAdmin, external? } in project.roles; built-in ids are role_owner, role_admin, role_staff, role_viewer, role_customer, role_public. Commands: create_role, update_role, delete_role. Default operations per built-in role are defined in src/core/permissions (DEFAULT_OPS).

Related

Was this helpful?