CRM & SaaS development

Role-Based Access Control for SaaS Teams

How to design role based access control for SaaS products: starting roles, permission keys, field-level visibility, server enforcement and how RBAC interacts with plans and tenants.

By Devang GandhiUpdated Nov 3, 20267 min read

Customers rarely ask for "role based access control." They ask for things like "my assistant should not see what I charge clients" or "the cashier should not be able to delete yesterday's bills." Good role based access control saas design is how you turn those sentences into rules your product enforces every time.

I have implemented permission systems in several products: owner, manager and staff roles in Client Mitra, super admin, admin and cashier roles in the HNEFA gaming cafe POS, separate agent and admin portals in an audit platform for an Australian accounting firm, and plan-based feature locks in the Antoc real-estate CRM. Here is the approach that has held up.

TL;DR

Start with three or four named roles that match how your customers talk about their team. Behind them, check granular permission keys in code. Handle field-level visibility (like money) explicitly. Enforce everything on the server, mirror it in the UI, and keep role checks, plan checks and tenant checks as three separate layers.

key takeaways

  • Start with a few named roles, but check fine-grained permission keys in code so roles can change without rewriting features.
  • Field-level visibility, such as hiding prices and profit from staff, is often what customers care about most.
  • Every permission must be enforced on the server; hiding a button in the UI is a convenience, not security.
  • Roles, plan-based feature locks and tenant isolation are three separate checks and should stay separate in code.

Roles for people, permissions for code

The mistake I see most often is code full of if (user.role === 'manager'). It works until a customer wants "a manager who can't issue refunds," and suddenly you are editing fifty files.

Instead, define permission keys such as bookings.create, invoices.view, payments.record, reports.profit.view, team.manage. Roles are simply named bundles of those keys. Code only ever asks "does this user have invoices.view?" Changing what a manager can do becomes a data change, not a code change.

A starting permission matrix

Here is a simplified matrix in the style I used for a studio CRM. The exact keys will differ for your product, but the shape transfers well.

Permission Owner Manager Staff
View assigned events and tasks Yes Yes Yes
Create and edit bookings Yes Yes No
View package prices and invoices Yes Yes No
Record payments and expenses Yes Yes No
View profit and financial reports Yes No No
Manage team members and roles Yes No No
Change subscription and billing Yes No No

Write a matrix like this with your customers before writing any code. It forces decisions that otherwise surface as support tickets.

Field-level visibility

Route-level checks are the easy part. The harder and more valuable part is fields. A staff member in a photography studio needs the event date, venue and client phone number, but not the package amount.

Practical rules:

  1. Shape responses on the server per role. Do not send the price to the client and hide it with CSS.
  2. Use a serializer or projection per permission set, so new endpoints do not leak sensitive fields by default.
  3. Check exports and PDFs too. A CSV export or invoice download is the most common place a hidden field leaks.
  4. Apply the same rules to push notifications and emails, which often include amounts.

Enforce on the server, mirror in the UI

The server is the only place a permission means anything. The OWASP Authorization Cheat Sheet puts it well: deny by default and validate permissions on every request.

My request pipeline is consistent across projects:

  1. Authenticate the user from a verified token.
  2. Resolve the active tenant and the user's membership in it.
  3. Load the membership's permissions.
  4. Check the plan allows the feature.
  5. Check the permission for the specific action.
  6. Run the query scoped to the tenant.

The frontend receives the same permission list and uses it to hide buttons and menu items. That keeps the interface clean, but it is never the line of defense.

Roles, plans and tenants are different questions

These three checks get tangled constantly:

  • Tenant isolation answers "which organization's data?"
  • Plan gating answers "has this organization paid for this feature?" Antoc uses plan-based feature locking for this.
  • Roles and permissions answer "is this person allowed to do this here?"

A feature should work only when all three pass, and each check should live in its own layer so you can change pricing without touching permissions, and vice versa. In Postgres products like HNEFA, tenant isolation is pushed further down into row-level security, with role checks layered on top.

Stronger auth for sensitive roles

Higher-privilege roles deserve stronger sign-in. On the audit portal, sign-in goes password, then email OTP, then an optional TOTP authenticator, with short-lived access tokens held in memory and httpOnly refresh cookies. Agents and auditors also use separate portals, which keeps admin-only actions like releasing a final report physically out of the agent interface.

How I built this in practice

In Client Mitra, memberships connect users to studios with a role of owner, manager or staff. Express middleware verifies the JWT, resolves the tenant and attaches permissions before any route runs. Financial fields are stripped from responses for staff, which is how a second shooter can see their call time and venue but never the package price. The same rules apply to the Flutter mobile apps, because they wrap the same web app and hit the same API.

The owner role also controls subscriptions, whether bought through Razorpay on the web or Apple in-app purchase on iOS, so only the person paying can change the plan.

Common mistakes

  • Checking role names directly in code instead of permission keys.
  • Hiding sensitive fields in the UI while still returning them from the API.
  • Forgetting exports, PDFs and notifications when restricting fields.
  • Mixing plan checks and role checks in the same condition.
  • Building a custom role editor before any customer has asked for one.

keep reading

FAQ

What is role-based access control in a SaaS app?+

It is a way of deciding what each user can see and do based on the role they hold within their organization, such as owner, manager or staff. Roles map to a set of permissions that the server checks on every request.

How many roles should a SaaS product start with?+

Usually three or four. Owner, admin or manager, and a standard staff role cover most SMB products. Add custom roles only when several customers ask for the same variation.

Should permissions be checked on the frontend or backend?+

Both, for different reasons. The backend check is the real security; the frontend check just hides actions the user cannot take so the interface stays clean.

What is the difference between RBAC and plan-based feature locking?+

RBAC decides what a person can do inside their organization. Plan-based locking decides what the organization has paid for. A feature should be available only when both checks pass.

Devang Gandhi

AI & full stack developer at Passdn, building CRMs, SaaS, AI agents and Flutter apps for clients in the US, UK, Australia, UAE and India. More about me

Read next

More in CRM & SaaS development