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 EngineeringMore guides
- 01 — BUILD
React Native or Flutter: how to choose for your product's app
React Native vs Flutter for your product's mobile app: team skills, code sharing with web, UI approach, native SDKs, hiring, maintenance and store release.
- 01 — BUILD
How to reduce cloud costs without losing recoverability
A practical approach to cutting cloud infrastructure costs: measure first, right-size, remove idle services, and keep backups and recovery intact.
- 01 — BUILD
Managed or self-hosted database: a per-workload decision
How to choose between a managed and a self-hosted database: cost, operational effort, failover, backups and team skills, decided per workload.
- 01 — BUILD
Why a stopped AWS database comes back on, and how to retire it properly
Stopped RDS, Aurora and DocumentDB clusters restart on their own after seven days. How to retire an old database safely, and find the other leftover costs.
- 01 — BUILD
Moving a live app to new infrastructure: a cutover checklist
How to move a live application and its data to new infrastructure without losing anything: discovery, rehearsal, verification, cutover and rollback.
- 01 — BUILD
Self-hosted video or a video API: choosing for a telehealth or consultation app
Building video consultations into your app? Compare a hosted video API with self-hosted WebRTC: cost, reliability, networks, privacy and team effort.
- 01 — BUILD
Rolling out access control on a live system: log mode first
How to introduce role-based access control into a live business system without disruption: catalogue routes, map roles, run in log mode, then enforce.
