What is RBAC, and why should a business care about permissions?
A software-as-a-service (SaaS) platform may serve many companies, locations and teams. Each person should see only the information and perform only the actions needed for their responsibilities. Role-based access control (RBAC) groups permissions into manageable roles instead of assigning every capability independently to every employee.
Consider a field-service platform. A technician records an inspection, a supervisor approves the report, finance issues invoices and a customer downloads their company’s records. All four users can sign in, but they should not have identical powers. A well-designed permission model clarifies accountability, prevents accidental changes and protects the information of other customers.
The essential distinction: authentication establishes who is signed in; authorization decides whether that person may perform a specific action on specific information. Signing in successfully never grants universal access.
Why are “admin” and “user” roles insufficient for B2B SaaS?
Two broad roles may work for an early prototype. They break down when one person belongs to multiple companies, manages only one branch or temporarily covers a colleague’s responsibilities. A global role stored on the user record cannot capture those differences reliably.
Separate three questions: Who is the user? Which organization are they acting in? What can they do there? An accountant may manage billing for one business while having read-only access to another. Removing access in the first business should not invalidate a legitimate relationship with the second.
Customer isolation is also a core SaaS promise. Every organization expects its records, reports and operational history to remain separate. Authorization must respect that boundary for reads, updates, downloads and automated processes, not merely for the navigation menu.
The building blocks of a practical permission model
Before implementation, describe access rules in language that product owners, operations managers and engineers can review together.
| Concept | Business meaning | Example |
|---|---|---|
| User | Human identity signing in | Field technician |
| Organization | Customer business and its information boundary | Company operating three branches |
| Membership | User’s relationship to a given organization | Employee belongs to two companies |
| Role | Named group of capabilities | Branch supervisor |
| Permission | Specific allowed business action | Approve inspection report |
| Resource scope | Records to which that permission applies | Assets assigned to one branch |
| Audit trail | Evidence of important actions | Who granted document access |
This separation keeps the product adaptable. One customer may call a role “Coordinator” and another “Operations Lead”, while both use stable permissions underneath. New product features should not silently grant new powers to everyone whose role happens to be named “Admin”.
Roles, capabilities and resource scope answer different questions
A role describes a person’s organizational responsibility. A permission describes an action, such as inviting an employee, approving an inspection or exporting a report. A resource rule defines the objects on which the action may be performed.
Two managers may both be allowed to update service orders, yet one manages the London branch and the other Manchester. Each has the same capability but a different scope. A completed order may also become read-only for both after financial approval. The authorization decision therefore depends on the current organization, the record and its status, not only the role label.
RBAC provides an understandable starting point. Relationship- or attribute-based rules can extend it where ownership, assignment, region or approval state matter. There is no need to introduce a complicated policy engine prematurely; rules simply need to be explicit, testable and consistent across the product.
Business scenario: inspections, approvals and customer documents
Imagine a platform used by companies performing recurring safety inspections. Technicians create reports and attach photographs. Supervisors review findings and approve final reports. Customers retrieve approved documents belonging to their company. Finance handles invoices. The software operator maintains the service but should not automatically edit every customer's business data.
| Operation | Technician | Supervisor | Customer |
|---|---|---|---|
| Record an assigned inspection | Yes | If assigned | No |
| Approve a report | No | Within assigned scope | No |
| Download an approved report | If assigned | Yes | Own company only |
| Change employee permissions | No | Only with explicit authority | No |
This is an illustration, not a universal role template. The actual design must decide whether contractors can access historical reports, who may reverse approvals, how access ends after a contract expires and which operations require additional confirmation. Those choices belong in the product requirements, not as undocumented developer assumptions.
How do you prevent access to another company’s records?
Hiding a button in the browser is not an adequate security measure. A user could request a different record identifier directly, call the application programming interface (API) or retrieve a document through a download link. The server must verify both the action and the resource’s organizational boundary independently.
Enforcement must cover searches, lists, detail views, file storage, exports, reporting, updates, deletion and background jobs. Selecting a company in the user interface does not prove membership. The server should resolve trusted identity and membership context and authorize each sensitive operation in that context.
PostgreSQL Row-Level Security (RLS) can add a second layer of protection by restricting which database rows a connection may read or modify. It does not replace application-level authorization. Tenant context must be established reliably, and privileged database connections must be considered because they may bypass row policies.
Read our separate guide to tenant isolation in SaaS architecture for the broader data-isolation model.
Invitations, role changes and access removal
Permissions are not a one-time configuration. A mature product handles invitations, onboarding, promotions, transfers between branches, temporary contractor access, leave and termination. The owner of each permission decision should be defined and visible to the organization.
Start with least privilege: give new members only the access their work requires. High-risk operations such as transferring account ownership, bulk exporting records or changing billing details may need extra confirmation or dual approval. Also design a safe recovery path when the only organization administrator becomes unavailable.
Revocation must have operational effect. A former employee should not retain access because an old session, cached authorization result or scheduled task still carries outdated permissions. For sensitive actions the system should re-evaluate current authorization and implement appropriate session invalidation or expiration strategies.
Contractors, service accounts and AI agents
Business processes increasingly involve outside service providers, scheduled automation and AI agents. Each needs a defined purpose and limited access. A contractor might maintain assets for one location until a specified date. An accounting integration might retrieve invoice information. An AI assistant might draft communications without permission to send them.
A background service should not impersonate an all-powerful administrator by default. Give it a separate identity with scoped capabilities. When an AI agent acts on a person's instruction, retain both the requesting human and the executing service identity so the resulting event can be explained.
Actions with serious consequences, such as changing payment destinations, deleting records or approving financial transactions, may require human approval. The same access policy must govern a command whether it comes from web, mobile, an integration or an AI tool.
Audit trails: useful evidence without unnecessary data exposure
An organization should be able to determine who granted permissions, changed a member’s role, approved a report or initiated a sensitive export. For significant events, record the actor, organization, action, target, time and outcome. Administrative changes may also need the prior and new values, together with a justification when appropriate.
Logging everything indiscriminately is not safer. Passwords, complete payment details and other secrets should not be copied into audit records. Define access controls, retention rules and data minimization for these logs. An audit trail helps investigations and accountability, but it is not a substitute for preventing unauthorized operations.
Where personal information is processed, access management and event logging can support privacy obligations, including data-protection-by-design principles. Neither RBAC nor a log file alone establishes regulatory compliance.
How can you test whether the controls actually work?
Successful administrator workflows are only half the test plan. The other half is demonstrating that an unauthorized user cannot bypass the model. Test denied operations with the same care as permitted ones.
- Can a member of company A read a document belonging to company B by changing an identifier?
- Can a supervisor edit an order assigned to another region?
- Does a removed employee retain access through a previously issued session?
- Do exports and attachments enforce the same boundaries as detail screens?
- What happens when a queued job runs after an employee loses permission?
- Can an AI agent carry out an action the requesting user may not perform?
OWASP recommends least privilege, deny-by-default behavior, authorization checks on requests and automated tests of access-control logic. These recommendations are most effective when included in product design rather than postponed until an incident. References: OWASP Authorization Cheat Sheet and OWASP Multi Tenant Security Cheat Sheet.
A sensible implementation or modernization roadmap
A running SaaS product with basic admin/member roles does not always require a complete rewrite. Start by mapping organizations, resources and business actions with financial, privacy or operational consequences. Decide who may grant access and how exceptions will be handled.
- Map business processes. Identify people, companies, branches, sensitive records and high-impact actions.
- Separate identity from organization membership. Support different permissions across companies.
- Define stable permission keys. Use roles as manageable groups rather than hard-coded application privileges.
- Add resource-level conditions. Consider ownership, assignment, geography and workflow status.
- Enforce checks on the server and audit important changes. Treat interface-level restrictions as usability improvements.
- Test denied access and migrate gradually. Preserve legitimate existing access and plan safe rollback.
Migration must account for live customers. Avoid unintentionally disabling existing workflows or automatically granting new powers. Each newly introduced product capability should receive an intentional permission mapping rather than inherit broad access accidentally.
What drives the cost of an authorization system?
The number of role names is rarely the main cost driver. Complexity comes from organization hierarchies, record-level rules, enterprise single sign-on (SSO), delegated administration, temporary access, approval steps, service identities, existing integrations and regression testing.
A small product may need only a few roles with consistent server-side checks. A multi-company enterprise platform may need customer-managed custom roles, external identity integration, time-limited access and safeguards around sensitive operations. Architecture should follow genuine business requirements rather than adopt the most complex model available.
Before requesting a development estimate, prepare a list of roles, important actions, resource restrictions and unusual cases. Clarify whether the product is new or already live. That information makes supplier proposals easier to compare and helps prioritize essential safeguards in the first release.
Product owner checklist
- Can a person work in multiple companies without mixing their records?
- Is responsibility for granting and removing access explicit?
- Do files, reports, exports and automation obey the same access rules?
- Are branch-specific and document-status rules enforced on the server?
- Does revocation affect existing sessions and scheduled work appropriately?
- Are important changes recorded without exposing unnecessary secrets?
- Do automated tests include attempted cross-tenant access?
Bottom line: effective B2B SaaS authorization is not about creating as many roles as possible. It is about clear responsibility, customer data boundaries and consistent enforcement across every interface. That foundation enables a product to grow without making customer access unpredictable.
For broader planning, read our practical SaaS development guide or explore SaaS development and custom web application development.
