Open MercatoDocsSearch docsAPI reference

Administer an app

Give a role access to the right records

A dispatcher for the North branch can look up the day's visits. A supervisor can also reassign them. Both may work for the same tenant, and neither should see records from an unrelated tenant. Use an organization boundary for the records and feature permissions for the actions.

What the three checks answer

A sales user with read permission and North branch scope can work with customer records in that branch.
A feature permission answers what a person can do. Organization scope determines which branch of the tenant they can work in.

Grant and test a role

  1. Sign in as an administrator with role-management access. In Settings, open Roles. Choose the role used by the test dispatcher and grant the view feature. Save the role.
  2. Open the dispatcher's user record. Check the role assignment and the organizations they can access. User-level overrides can change their effective permissions, so inspect those when two users with the same role see different results.
  3. Sign in as that dispatcher and select North in the organization picker. Open a visit owned by North. Then try the management operation with the same account. The read should succeed and the write should be denied.
  4. Test with a second organization and a separate, unprivileged account. Check the detail API as well as the list. A missing menu item alone cannot establish that a record is protected.

Apply the check where the data moves

Declare the feature in your module's acl.ts. Attach requireAuth and requireFeatures to page or route metadata as appropriate. Use the effective request scope when querying the record, including on a lookup by ID. A background job needs the tenant and organization explicitly because it runs outside the original session.

Go further

Role settings implementation · Organization hierarchy and selector · Module feature declarations

Previous: Add a page from your own module · Next: Run an agent in Playground