Preview as a role
"Preview as" shows your app exactly as a given role sees it: which pages exist in the menu, which components are visible, which records a customer can read. It is the fastest way to check permissions without creating test accounts and signing in and out.
"Preview as" shows your app exactly as a given role sees it: which pages exist in the menu, which components are visible, which records a customer can read. It is the fastest way to check permissions without creating test accounts and signing in and out.
When to use
- Check that customers only see their own records in a portal.
- Confirm that a page marked "team only" is hidden from visitors who are not signed in.
- See what a Viewer can and cannot change.
How to use it
- Open Preview.
- In the preview toolbar, choose a role in Preview as: Public, Customer, Viewer, Staff, Admin, Owner or any custom role you created. The preview restarts with that role.
- For non-admin roles, an extra field appears: as user email (for "own records"). Type an email such as
anna@example.comand leave the field. Permission rules that compare a record field with the current user's email now use that address. - Walk through the app. Pages the role may not open show "Please sign in" (public) or "You don't have access to this page" (signed-in roles without access).
Preview as: [ Customer ▾ ] as user email: [ anna@example.com ] Menu shows: Dashboard · Requests · Files · Messages Hidden: Jobs, Customers (team only) Requests: only rows where Customer email = anna@example.com
What each role sees
- Public: the visitor is not signed in. Only pages that do not require sign-in; entity access only through explicit Public rules.
- Customer: a signed-in external user. Pages open to customers; records limited by "own records" rules.
- Viewer / Staff / Admin / Owner: team roles. Admin and Owner have full access and never need the email field.
- Custom roles behave according to their page access and permission rules.
The simulated user is named "Preview (Role)" and is treated as signed in, so components bound to the current user (name, email, role) show these values.
Full-screen preview as a role
The Full screen button carries the role and email into the URL (?role=…&email=…). Without a role parameter the full-screen preview uses the Owner role and your builder email.
Common mistakes
- Forgetting the email for own-records rules. Without an email that matches a record, a customer sees an empty list. That is the correct behaviour, not a bug: make sure test records carry the email you preview with.
- Expecting the sign-in form to work. Sign-in is simulated in preview; switch roles with the picker instead.
- Testing admin-only data in Data › Records as a customer. The Data view is for builders; use Preview as to test what app users get.
Advanced
Preview as applies configForUser(project, user), the same function the server uses when delivering the configuration to a real app user. Pages the role may not open are replaced by a denied stub, components restricted with Permissions are removed, and server-only details (API URLs, workflow steps, environment variables) are stripped. Record filtering happens on the server through the data engine, with the preview email substituted for the user's email. Managing records as a role from the Data view is not part of preview.