Guide · Apps & software
Designing roles and permissions in business applications
In any application used by more than a few people, the question "who can see and do what?" comes up early and never goes away. Get it wrong, and either people cannot do their jobs, or they can see data they should not — including other clients' data in a portal or SaaS product. Designing roles and permissions deliberately is part of the core architecture, not an admin setting added at the end.
[ 01 ]
In short
In short
- 01
Start from real jobs and tasks, not from a list of screens.
- 02
Apply least privilege: each role gets the access needed for its tasks and no more.
- 03
Separate what users can do (actions) from which data they can do it to (scope).
- 04
Enforce permissions on the server, never only by hiding buttons.
- 05
Log sensitive actions so you can answer "who changed this?".
[ 02 ]
Guide
Roles and permissions
- Permissions are specific rights: view orders, edit prices, approve discounts, export data, manage users.
- Roles group permissions for a job: sales manager, warehouse operator, accountant, administrator.
Users are assigned roles; roles carry permissions. This keeps administration manageable as the team grows.
Scope: which data
Permissions answer "what can I do?"; scope answers "to which records?":
- a sales manager sees their own clients, a head of sales sees the whole team's;
- a branch manager sees their branch;
- a client in a portal sees only their company's data;
- a SaaS customer's users see only their organisation's data. See multi-tenancy.
Scope rules must be applied in every query on the server. Many data leaks happen because an application checks whether a user can view orders, but not whose orders.
Designing from jobs
- List the people who will use the system and what they do daily.
- For each task, note the data and actions it requires.
- Group into roles; check for overlaps and gaps.
- Identify sensitive actions — deleting records, changing prices, exporting personal data, refunds — and restrict them.
- Decide who administers users and roles.
Delegation and client-side administration
In portals and B2B products, clients often need to manage their own users: add a colleague, remove someone who left, change permissions within limits. A client administrator role with limited rights reduces work for your team and keeps access current. See customer portals.
Approvals
Some actions need a second person: large discounts, refunds above a threshold, publishing content. Approval workflows combine permissions with process: one role creates, another approves.
Audit logs
Record who did what and when for sensitive data and actions: changes to prices, statuses, permissions, exports and deletions. Logs help resolve disputes, detect misuse and meet data protection expectations.
Common mistakes
- Only hiding UI elements: permissions must be checked on the server for every request.
- Too many custom roles: every user with a personal set of rights becomes unmanageable.
- Shared accounts: several people using one login make audit logs meaningless.
- Forgotten access: former employees and contractors who still have accounts. See access management for teams.
- Admin for everyone: convenient at first, dangerous later.
Testing permissions
Test each role with realistic scenarios, including attempts to access other users' or clients' data by changing identifiers in requests. This is a standard part of a security audit.
[ 03 ]
FAQ
Frequently asked questions
How many roles should an application have?
As few as possible while covering real jobs — often three to seven for an internal tool. Add roles when a real need appears.
Can permissions be changed without a developer?
Usually yes, through an admin interface for assigning roles. Changing what a role can do may be configurable or may require development, depending on the design.
What about personal data?
Restrict access to personal data to roles that need it, log access and exports, and follow Azerbaijan's personal data law. See personal data law.