Authorization and access control: define who may do what
Define object-level permissions, deny access by default and test that users cannot reach another user's or tenant's data.
Authentication establishes identity. Authorization decides whether that identity may perform a particular action on a particular resource. A person can be correctly signed in and still have no right to read another customer's invoice, edit a colleague's document or administer another tenant.
The OWASP Authorization Cheat Sheet recommends least privilege, denial by default and permission checks on every request. Those principles become useful when translated into an explicit policy and tests, rather than a vague requirement that "the app has roles."
Start with resources and actions
List the things the application exposes, such as projects, invoices, files, exports and administrative settings. Then list the operations on each: view, create, edit, delete, approve or share.
Finally, identify the condition that permits the action. A role might be part of that condition, but ownership, tenant membership or the resource's state may matter too.
This illustrative project-app matrix is an original starting point, not a ready-made policy:
| Actor | Resource and action | Example rule |
|---|---|---|
| Project member | Read a project | Allowed only for a project they belong to |
| Project editor | Edit a document | Allowed only within an assigned project and scope |
| Billing contact | Read an invoice | Allowed only for their own tenant's billing records |
| Tenant administrator | Manage membership | Allowed only inside that tenant |
| Unauthenticated visitor | Read a private export | Denied |
The purpose is to expose decisions before implementation. A label such as "administrator" does not automatically mean global access to every customer account.
Enforce object-level access, not just role access
Checking that someone is a "customer" says little about which customer's order they may read. An endpoint receiving an order ID needs to authorize access to that specific order.
OWASP describes the risk of changing an identifier in a URL or request to reach another person's data. Random or hard-to-guess IDs may reduce easy guessing, but they are not a replacement for the permission check.
Ask a concrete question: if an authorized test user submits another test user's valid record ID, does the server deny access because the policy forbids it, or only because that record happened not to exist in the test database?
That distinction separates a genuine authorization test from a coincidental "not found" result.
A hidden button is not an access-control boundary
Client-side checks can hide irrelevant actions and improve usability. They must not be the final decision about permission, because a caller can bypass the interface and send a request directly.
OWASP says access checks belong on the server, at a gateway or in serverless functions, according to the architecture. The important requirement is that the decision cannot be bypassed merely by changing browser code or calling the endpoint another way.
Apply it consistently to background requests and administrative routes as well as visible page loads. A mostly protected application can still expose data through one missed endpoint.
Files and exports are resources too
It is easy to protect an invoice page while leaving the downloaded invoice file at an unrestricted address. OWASP explicitly includes static resources and cloud-stored files in access-control policy.
Review whether a person who can no longer open a project can still fetch its exports through another route. Use the storage provider's current access-control documentation for the actual implementation; this article does not prescribe a bucket configuration or sharing-link lifetime.
Public assets and private documents need different policies. Do not apply a blanket private setting that breaks intended public content, or a blanket public setting because it makes downloads convenient.
Deny by default and fail safely
When no policy explicitly permits a request, deny it. When an authorization dependency fails or an exception occurs, do not let the error turn into access.
Centralized policy enforcement can reduce missed checks, but configuration still needs testing. Framework features do not know the product's intended trust boundaries unless the team expresses them.
Log enough to investigate authorization failures without exposing sensitive data or debugging detail to the caller. The amount and content of logging should be chosen deliberately for the application, not maximized without limit.
Query safety does not grant access
Parameterized queries stop supplied values from changing SQL syntax. They do not decide whether the caller may access the matching row.
Treat injection prevention and authorization as separate requirements. A query can be perfectly parameterized and still return another tenant's information if the permission boundary is missing.
Test forbidden actions as well as allowed ones
Our suggested review uses several dedicated test identities with different roles and memberships. For each important resource, check both permitted and forbidden operations. Include another user's valid object, another tenant's valid object, direct file access, and a newly added feature with no explicit grant.
Record the expected denial and the actual result. Then keep those cases in regression tests so a refactor does not quietly widen access.
OWASP recommends unit and integration tests while making clear that they do not replace skilled security testing. A permission matrix plus passing tests is useful evidence, not a certificate that every authorization path is safe.
By Omnistu. Technical guidance reviewed 16 November 2026. Examples are hypothetical; no application or customer system was tested.