RBAC Matrix Builder
Lay out roles, resources and actions in a grid, then export the matrix or working policy code.
- Free
- No sign-up
- Your input stays in your browser
Using a template replaces the current matrix. The download is the matrix as shown, ready for Excel or Google Sheets. Your work is saved in this browser only.
Permission matrix
- Yes any record
- Own only records they own
- Yes ↑ inherited from another role
Click a cell to cycle it: no access, any record, own records only. Change roles and resources below the matrix.
Roles
Resources and actions
Checks
Export
Import a JSON export
Fixed‑scope pilot · Paid
Need this built into your product?
One agreed piece of your product, built and shipped, so you judge the work on real code.
Starts with a free 30-minute intro call, or email hello@nestedbit.com.
What an RBAC matrix is
Role-based access control (RBAC) gives permissions to roles, and roles to people. An RBAC matrix, also called a permission matrix, lays that out as a grid: one row for each action on each resource, one column for each role, and a mark where the role may act. It’s the quickest way to get product, engineering and security to agree on access before any code is written.
How to build one
- List the resources: the things in your product people act on, such as projects, invoices or users.
- List the actions on each: start with read, create, update and delete, then add the ones your business has, such as approve, refund or share.
- List the roles by job, not by person. Start with as few as you can.
- Fill in the grid, marking where a role may act only on its own records.
- Read the checks and fix duplicates, unused roles and anyone who can approve their own work.
Start from a template if one is close: SaaS, e-commerce, finance and agency are built in. Each one downloads as a filled-in spreadsheet, so you can use it in Excel or Google Sheets. See them all, and what to change in each, in RBAC matrix templates.
Own records and inheritance
Many permissions only make sense on a user’s own records: an employee edits their own expense claims, not everyone’s. Marking a cell Own keeps that in one role instead of creating a second, near-identical role. Every export carries it through as an ownership check.
Inheritance lets a role build on another: an Admin who inherits Member gets everything a Member can do, plus more. Inherited cells show an arrow and are changed on the role they come from. Exports write inherited permissions out in full, so each role’s policy is complete and easy to review.
When roles start multiplying to cover teams, regions or limits, it’s time for rules over attributes. Read RBAC vs ABAC for how to combine the two.
From matrix to code
- CSV and Markdown for spreadsheets, documents and reviews.
- JSON to save the model, import it later, or drive your own code.
- Casbin model and policy files, with optional tenants (Casbin domains).
- OPA Rego for services that ask Open Policy Agent for decisions.
- Cedar policies, for Amazon Verified Permissions or the Cedar SDK.
- Postgres row-level security, so the database enforces the same rules as your API.
If you sign users in with JWTs, check what your tokens carry with the JWT Security Inspector. Keep roles in tokens coarse and short-lived, and look fine-grained permissions up on the server.
Roles for AI agents
An AI agent that acts in your product should hold a role like anyone else, never borrow a person’s. Give it the narrowest role that does its job: in the SaaS template, the AI assistant can read projects and documents and draft new ones, but can’t delete, share or change members.
For the jobs that suit an agent, and how much freedom to give each one, see AI agent use cases.
Questions
What is an RBAC matrix?
A table with one row for each action on each resource and one column for each role, marking which roles may take which actions. It’s also called a permission matrix or a roles and permissions matrix, and it’s the quickest way to agree on access before writing code.
What does “Own” mean in a cell?
The role may take the action only on records the user owns, such as their own expenses or documents. Every export carries this through: an owner check in Rego, Cedar and SQL, and an ownership flag in Casbin.
How does role inheritance work?
A role that inherits another gets all of its permissions, plus its own. Inherited cells show an arrow. Exports write inherited permissions out in full, so each role’s policy is complete on its own.
Can I open the matrix in Excel or Google Sheets?
Yes. Use Download CSV for Excel at the top of the tool and open the file in Excel or Sheets: one row per resource and action, one column per role. Pick a template first if you want a filled-in matrix to edit.
Is the generated policy code ready for production?
It’s a tested starting point: the Casbin output is checked with Casbin, the Cedar output with Cedar, and the SQL with Postgres’s own parser. You still need to connect it to how your app identifies users and owners, and test it against your data.
Where is my matrix stored?
Only in this browser’s storage, so it’s still there when you come back on the same device. Nothing is sent to NestedBit. Use the JSON export to keep a copy or move it to another device.
Can I generate the policies in code?
Yes. The engine behind this builder is open source (MIT) as the npm package @nestedbit/access-model, at github.com/nestedbit/access-model. Load the JSON export with fromJson, then call toRego, toCedar, toCasbinPolicy or toPostgresRls in your build or tests; the same package writes Supabase policies and Firestore rules.