Skip to main content
ProsperousTech
01 — BUILD: Product Engineering

How to design role-based access for operations software

Operations software is used by people with very different jobs: agents, supervisors, finance, administrators. Each needs to see and change different things. Get access control wrong and the result is either a system so locked down that people share logins to get work done, or one so open that anyone can change anything.

Role-based access control (RBAC) is the usual answer, but the details decide whether it stays manageable. This guide covers the design choices we make when building access control into business systems.

1. Separate permissions from roles

A permission is a single, specific action: view timesheets, approve leave, import work items, manage users. A role is a named bundle of permissions that matches a job. Code checks permissions, never role names.

This separation is what keeps the system flexible. When a new job appears, you create a role from existing permissions instead of changing code. When a feature is added, you add a permission and decide which roles get it.

  • Name permissions by resource and action, such as timesheets.approve
  • Keep the permission list in one place, shared by the server and the interface
  • Check permissions in code; treat role names as data

2. Deny by default, enforce on the server

Every route or operation should require an explicit permission. If a developer forgets to declare one, the request should fail, not succeed. A guard that denies by default turns a forgotten check into a visible bug instead of a silent security hole.

Enforcement belongs on the server. Hiding a button in the interface is good usability, but it is not security: anyone can call the underlying endpoint directly.

3. Allow custom roles, within a ceiling

Organisations always want roles you didn't predict. Letting administrators create custom roles avoids constant change requests, but it introduces a risk: an administrator who can create roles could create one more powerful than their own.

The fix is a permission ceiling. A user can only grant permissions they themselves hold. System roles stay fixed and protected, and custom roles live inside the boundaries they define.

  • Protect system roles from editing or deletion
  • Never let a user grant a permission they don't hold
  • Show administrators clearly what each permission allows

4. Scope data, not just actions

Permissions answer what someone can do. Scoping answers to which records. A supervisor may approve timesheets, but only for their own team; a user in one organisation must never see another organisation's data.

Apply scoping in the data layer, so every query is filtered by organisation, and where needed by team or owner. Relying on each endpoint to remember the filter is how cross-tenant data leaks happen.

5. Secure the account, not just the role

Access control is only as strong as authentication. A few basics prevent most account-level problems.

  • Short-lived access tokens with refresh tokens that rotate on use
  • Account lockout or throttling after repeated failed logins
  • A forced password change when an administrator sets an initial password
  • Rate limits on login and other sensitive endpoints
  • Immediate effect when a role is changed or a user is deactivated

6. Keep an audit trail

Operations teams need to answer questions like who changed this record, who granted that role, and when. Record security-relevant events: logins, role and permission changes, approvals, imports and deletions, with who did it and when.

An audit trail is also what makes access control reviewable. Periodic reviews of who holds which role are far easier when the history is already recorded.

7. Test permissions like features

Access control rules are business rules, and they deserve automated tests. Test that each role can do what it should, and just as importantly, that it cannot do what it shouldn't.

  • A test that fails if any route has no declared permission
  • Allowed and denied cases for each role on sensitive operations
  • Cross-organisation tests that try to read or change another tenant's data
  • Tests for the permission ceiling on role creation

Common questions

Should we use roles or individual permissions?

Both. Code should check individual permissions, and people should be assigned roles that bundle them. That keeps the code stable while letting the business define roles that match real jobs.

Is hiding menu items enough to restrict access?

No. Hiding options in the interface helps users, but every action must also be checked on the server, because the underlying endpoints can be called directly.

How do we stop administrators creating overly powerful roles?

Apply a permission ceiling: a user can only grant permissions they already hold, and built-in system roles can't be edited.

Related service

Build products customers can rely on.

Product Engineering 

More guides

Have a project in mind?

Tell us what you need to build.

Share where the product is today and where it needs to go. We'll suggest a sensible first step.