Roles and permissions: designing access for staff and clients

Design access by listing who needs to do what, grouping it into a few roles, and checking every request on the server. RBAC, its limits and the pitfalls.

By Sohail Hussain21 November 20265 min read

Design access in three moves. List who needs to see and do what. Group those needs into a small number of roles. Then add a second rule for which records each person can reach, such as "only their own company's orders" or "only jobs in their branch". Enforce both on the server, for every request, deny anything not explicitly allowed, and log what people do. Roles answer "what can this kind of user do?" Scope answers "on which records?" Most access bugs come from forgetting the second question.

Access design is part of every portal and internal tool we build through our client portals and internal tools service. It is one of the decisions that is cheap to get right at the start and painful to retrofit, as custom software vs off-the-shelf notes.

What is role-based access control?

Role-based access control, or RBAC, groups permissions into roles and assigns people to roles, rather than granting permissions to individuals one at a time. When someone joins, you give them a role. When the rules change, you change the role, and everyone in it changes together.

The clearest way to design and document it is a matrix. Here is one for a typical order-management tool with a client portal:

ActionAdminManagerStaffClient adminClient user
View ordersAllAllAssigned to themOwn companyOwn company
Edit ordersYesYesAssigned to themNoNo
Approve discountsYesYesNoNoNo
See cost and marginYesYesNoNoNo
Export dataYesYesNoOwn companyNo
Manage usersAllTheir teamNoOwn companyNo

This table is the specification, the documentation and, later, the test plan. Notice that the cells are not just yes or no. "Assigned to them" and "own company" are scope rules, and they matter as much as the roles.

How do you design roles for your business?

  1. List the things and the actions. Things: orders, jobs, invoices, documents, users, settings. Actions: view, create, edit, approve, delete, export.
  2. Talk to real people. Ask three or four of them what they do in a week and what they should never be able to do. Job titles are not roles; two "coordinators" may do quite different work.
  3. Group the needs into four to six roles. If two groups differ by one permission, consider whether they really need separate roles.
  4. Write the scope rules separately. Own company, own branch, assigned to me, created by me.
  5. Name the exceptions and handle them deliberately, with a single extra permission or an approval step, rather than a new role for each one.
  6. Decide who can grant access. Usually admins for staff, and client admins for their own colleagues.

Why are roles not enough on their own?

Because two clients have the same role and must see completely different data. A client user at Company A and a client user at Company B have identical permissions and no overlap in what they may see. That separation comes from scope, not roles; for software sold to many customers, it is the core of multi-tenant SaaS architecture.

This is why the OWASP Authorization Cheat Sheet recommends preferring attribute- and relationship-based rules over pure RBAC. Attribute rules compare properties: the user's branch matches the record's branch, the discount is under the user's approval limit. Relationship rules follow links: the user is a member of this project, the contact belongs to this company.

In practice, most business tools need roles plus a handful of such rules, not a policy engine. Field-level rules belong in the same design: cost prices, margins, salaries and personal data are often visible to some roles in a record and hidden from others.

Where do permission systems usually go wrong?

Broken access control is first in the OWASP Top 10:2025, and OWASP reports that every application tested for it had some form of the problem. The usual causes:

  • Checks only in the interface. Hiding a button does not stop someone sending the request directly. The server must check every time.
  • Allowed by default. A new screen or API endpoint is open until someone remembers to lock it. Deny by default instead.
  • Guessable IDs without ownership checks. Changing /orders/5512 to /orders/5513 should return "not found", not someone else's order.
  • Side doors. Exports, search, reports, file links and mobile app endpoints that skip the rules the main screens follow.
  • Role sprawl. Thirty roles nobody understands, so people get admin rights "to make it work".
  • Leavers. Accounts nobody disabled and logins shared between staff.

How should staff and client access differ?

StaffClients
Sign-inCompany Google or Microsoft accountInvitation, then a sign-in link or password
Two-factorRequiredOffered, required for client admins
Who manages accountsYour adminsTheir own client admin
When someone leavesDisabled centrally with their company accountRemoved by the client admin
What they seeBy role and branchOnly their own company's records

Two more things matter. When support staff need to see what a client sees, give them a logged, time-limited "view as" feature rather than asking for the client's password. And keep an audit log for both groups: who viewed, changed or exported what, and when. For the sign-in technology itself, authentication options for web apps compares the common choices, and client portal: what it is and what to include covers the wider portal design.

How do you test and maintain permissions?

Turn the matrix into automated tests. One test per role and action, run on every change. OWASP lists unit and integration tests for authorisation logic among its core recommendations.

Run the two-account test. Sign in as two different clients side by side and try to reach one's records from the other, by changing IDs, editing requests and opening exported files.

Check tokens. If your app keeps roles inside a signed token such as a JWT, a role change only takes effect when the token is renewed, so keep lifetimes short. Our JWT decoder shows what a token actually carries.

Review access every quarter. Export the list of users and roles, remove leavers and downgrade anyone with more access than their work needs.

Log refused requests. A burst of "access denied" from one account is worth a look.

To start, draw the matrix for your own tool on one page, with real people's names under each role. Gaps and overlaps show up within minutes, and the page becomes the brief for whoever builds or audits the system.

Was this guide useful?

Questions

Frequently asked.

What is the difference between RBAC and ABAC?

Role-based access control (RBAC) grants permissions by role: managers can approve discounts. Attribute-based access control (ABAC) decides using attributes of the user, the record and the situation: a manager can approve discounts under ₹50,000 for their own branch. Most business tools use roles for the broad strokes and a handful of attribute rules for scope.

How many roles should a business application have?

Fewer than people expect. Four to six roles cover most internal tools and portals, with scope rules handling which records each person sees. If you find yourself creating a role for one person, that is usually an exception to handle another way, such as a single extra permission or an approval step.

Should clients manage their own users?

For business clients with more than a couple of people using your portal, yes. Give each client company an admin who can invite and remove colleagues within their own company. It removes a support burden from your staff and means people who leave the client's business lose access faster, because the client notices first.

Sohail Hussain

Founder, MSH Technologies

Sohail has designed and built websites, web apps and AI products for over 12 years, for clients from Singapore-based industrial groups to early-stage SaaS startups. He writes about what actually worked.

Keep reading

Related guides.

All posts

Your next move

Like what you see? Tell us about it.

A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.

India · Working with clients worldwide

Sohail, Founder, replies within 1 working day (Mon–Sat, IST). Free and no obligation.