Skip to content

Decisions7 min read

Roles, permissions and audit trails: what to ask for in business software

By Published

Short answerAsk for four things in writing. A list of roles with the exact actions each one may take. Access that is denied unless a rule allows it, checked on the server for every request. Record-level rules that say which branches, customers or patients each person can see. And an audit trail that records who did what, when and where, without ever storing passwords, tokens or card data.

A permission names an action, a role bundles permissions

A permission is one action on one kind of record: create an invoice, approve a refund, export the customer list. A role is a named bundle of permissions that you hand to people. NIST's glossary describes role-based access control as a model where permitted actions on resources are identified with roles, not with individual identities. One role can apply to a single person or to several.

That is the right starting point for most business systems. You manage five roles, not fifty staff. When someone changes job, you change their role and nothing else.

Roles alone do not answer one question: which records. A sales role says a person may edit customers. It does not say whether that means every customer or only their own. OWASP's Authorization Cheat Sheet goes further and says attribute and relationship based access control should typically be preferred over plain roles for application development. For an owner, the practical version is this: ask for roles, and then ask what limits each role by branch, owner or status.

Deny by default, and check on the server every time

Three rules from the OWASP cheat sheet belong in every scope document. An application should deny access by default. Permission should be validated on every request. And developers must never rely on client-side access control checks, because the checks must be performed server-side.

In plain terms: hiding a button is not security. If the Delete button is hidden for a cashier but the server still accepts the delete request, anyone who knows the address can send it. OWASP's Top 10 for 2021 lists broken access control as category A01 and reports that 94% of applications were tested for some form of it. Its examples include bypassing checks by modifying the URL, and viewing or editing someone else's account by providing its identifier.

Least privilege is the companion rule. NIST frames it as giving each user the minimum access needed for their function. OWASP adds that it applies horizontally and vertically, which means between people at the same level as well as between juniors and managers. A new role should start with nothing and be given permissions one at a time.

An example matrix for a small trading company

This is an example I made up for a company with a shop, a store room and one accountant. Your roles and rows will differ. The format is what matters, because a matrix like this is the fastest way I know to find disagreements before any code is written.

  • One row is No for everyone. An issued invoice is corrected with a credit note, not edited.
  • The system admin manages accounts and sees no business data.
  • Blank cells are not allowed. Every cell is Yes, No or a stated limit.
ActionOwnerAccountantSalesStorekeeperSystem admin
View customersYesYesOwn customersNoNo
Create a quotationYesNoYesNoNo
Approve a discount above the limitYesNoNoNoNo
Issue an invoiceYesYesNoNoNo
Record a payment receivedNoYesNoNoNo
Edit an issued invoiceNoNoNoNoNo
Adjust stock quantityNoNoNoYes, with a reasonNo
Approve a stock write-offYesNoNoNoNo
Create users and assign rolesNoNoNoNoYes
Read the audit trailYesYesNoNoNo
Export the customer listYesNoNoNoNo

Record-level rules: which rows, not which screens

The cell that says 'Own customers' is a record-level rule. So is a branch manager who sees only one branch, or a doctor who opens only the files of patients assigned to them. These rules are easy to say and easy to get wrong when they are repeated by hand in every query.

I prefer to put them in the database as well as in the application. PostgreSQL's row security policies restrict, per user, which rows normal queries return and which rows can be inserted, updated or deleted. A policy can be specific to a command, to a role, or to both. So reading and changing can follow different rules: PostgreSQL's own documentation shows one policy that lets everyone view all rows and another that lets each user modify only their own.

If row security is enabled and no policy exists, the documentation says a default-deny policy is used, and no rows are visible. I like that failure mode. A forgotten rule shows an empty screen, which someone reports the same day. It does not show another branch's sales figures.

Separation of duties, and why full admin access is a decision

NIST defines separation of duty as the principle that no user should be given enough privileges to misuse the system on their own. Its example is close to home for any business: the person authorizing a paycheck should not also be the one who can prepare them. It can be enforced by defining roles that the same user cannot hold together, or at the moment of the action, as in the two-person rule, where the second approver must be a different authorized user from the first.

This is why I treat 'admin can do everything' as a decision and not a default. A single super admin is the cheapest thing to build, so it tends to be the default. But an account that can create a supplier, approve its invoice, release the payment and then edit the history is one stolen password away from a very bad month.

My rule: split the technical admin from the business approver, as the matrix does. Give nobody the right to approve their own request. If the business is too small for that, keep the single owner account, name it as an accepted risk in the scope, and make sure its actions land in an audit trail the owner cannot edit.

What the audit trail records, and what it must never hold

OWASP's Logging Cheat Sheet says application logs must record when, where, who and what for each event. For a business system that means the time, the screen or service, the user and their source address, and the type of event with a description. It also lists events to log wherever possible, including authentication successes and failures, authorization failures and the use of higher-risk functionality.

The trail itself needs protecting. OWASP recommends tamper detection, so you know if a record has been modified or deleted, and says access to the logs should be recorded and the right to read them restricted and reviewed.

The audit trail I would ask for covers these, always:

  • Sign-ins, failed sign-ins and password resets.
  • Every refused action, with the permission that was missing.
  • Changes to users, roles and permissions.
  • Changes to money: prices, discounts, invoices, credit notes, payments, refunds.
  • Stock adjustments and write-offs, with the reason typed by the user.
  • Approvals and rejections, with the requester and the approver.
  • Exports and bulk downloads of customer or patient data.
  • Deletions, with the old value kept.
  • Never in the log, following OWASP's exclusion list: passwords, session identifiers, access tokens, encryption keys, database connection strings, bank account or payment card data, and sensitive personal data. These are removed, masked or hashed first.

Scope questions, and how access rules fit my packages

On price first. My Scale package, at $2,500, includes an admin dashboard scoped to your operations, and Growth, at $1,699, includes admin tools for the basics. An ERP, CRM or HMS with a full matrix, approval chains and an audit trail is custom software, which I quote separately as a fixed price after a written scope. Hosting, third-party fees and ongoing maintenance are not included.

Whoever builds it, put these questions in the scope before you compare quotes. If you send me your list of roles, I will send back a draft matrix with the cells I would question.

  • Which roles exist on day one, and where is the matrix?
  • Is access denied by default, and is every check made on the server?
  • Which record-level rules apply: branch, owner, department, status?
  • Which actions need a second person?
  • What can the top admin account not do?
  • Which events go into the audit trail, who can read it, and can anyone edit it?
  • How long is the trail kept, and can it be exported?
  • Is there a test for each role that tries the actions it must be refused?

Questions

What is the difference between a role and a permission?
A permission is a single allowed action, such as approving a refund. A role is a named set of permissions given to people who do the same job. You assign roles to staff and permissions to roles.
Should an audit trail record passwords or card numbers?
No. OWASP's Logging Cheat Sheet lists authentication passwords, access tokens, session identifiers, encryption keys and bank account or payment card data among the items that should not be recorded directly in logs.
Can roles be added after the system is live?
Yes, if permissions were built as separate named actions from the start. Adding a role is then a matter of choosing its permissions. If access was hard-coded as admin or not admin, adding a role means reworking every screen.

Sources

Platform rules and fees in this article were checked against these official pages on 12 November 2026. They change, so confirm before you rely on them.

Sannan Malik is a software architect and product builder with 8+ years in software, CEO of Alpha Notic FZE and a Certified Scrum Product Owner. He builds mobile apps and business software for companies in the UAE, the wider Gulf, the UK, the US, Canada and Australia.

Let's build it

Got an idea? Let's talk.

The fastest way to reach me is WhatsApp. Tell me what you're building and I'll reply with how I'd approach it, which package fits, or what a custom scope would look like.

Message me on WhatsApp