Skip to content

Updating visuals

If you see any images containing outdated UI, please bear with us.

We are updating all content as quickly as possible to mirror our new UI.

Return

Using user roles

Control what users can see and do by assigning roles and checking them in your app.

Steps at a glance ​

  1. Create roles in the Authentication subtab of Data & API.
  2. Assign roles to users.
  3. Use roles to protect pages and APIs.

1) Create roles ​

  1. Open the Data & API tab, then open the Authentication subtab.
  2. Go to Roles.
  3. Click Insert, enter a Name that matches your needs (for example admin or member), then click Insert.
The Roles tab of the Authentication subtab, with the admin role in the list and the Insert button

2) Assign roles to users ​

  1. Open the Data & API tab, then open the Authentication subtab and go to Users.
  2. Click the pencil icon next to the user's checkbox to open Update User.
  3. In the roles field, select the appropriate roles, then click Save.
The Update User window of a test user, with the admin role checked in the roles field

3) Use roles in your app ​

  • Protect pages so only certain roles can open them: in the page's Private access settings, set Who can access this page to Authenticated users, then choose the roles in Roles who can access this page.
  • Restrict table views so only certain roles can retrieve their data: click the access button in the view header, choose Authenticated, then choose Match any or Match all and select the roles.
  • Secure API endpoints with Security settings (and optional Middlewares for custom role checks) so only allowed roles can access sensitive data.

Learn more about where roles are enforced →

Common pitfalls ​

A user is signed in but still blocked ​

  • Confirm they actually have the role assigned.
  • If you just assigned the role, ask them to refresh the page. Role changes take effect after a refresh.
  • Confirm the page or API is checking the same role name.