Role and attribute based access control

A role describes a useful responsibility, but permission often depends on the resource, tenant, amount, purpose, and current state. Make the final authorization decision where the protected operation is performed.

Checking an invoice approval request

The invoice exceeds the approver’s limit. All seven conditions must pass before approval is allowed.

Decision request

Actor
user_1042
Action
invoice.approve
Resource
invoice_620
Invoice amount
USD 6,200
Actor’s approval limit
USD 5,000
  • Active identity

    Active session for user_1042

    Session service
    Met
  • Tenant membership

    Actor and invoice belong to north

    Membership store + invoice record
    Met
  • Approval role

    Actor holds the approver role

    Role assignment
    Met
  • Permitted business unit

    Operations is within the actor’s authority

    Policy attributes + invoice record
    Met
  • Amount within limit

    USD 6,200 exceeds the USD 5,000 limit

    Approved limit + current invoice amount
    Not met
  • Separation of duties

    Submitter user_2049 differs from user_1042

    Invoice record
    Met
  • Current resource state

    Invoice is pending review

    Authoritative invoice record
    Met

Deny approval

The amount is USD 1,200 above the actor’s limit. Other matching conditions cannot override this failed requirement.

Confirm approval rules with the business owner. Evaluate current permissions, limits and resource state when the action is requested.

Define actions and resources

List meaningful actions such as invoice.read, invoice.review, and invoice.approve. Distinguish reading a summary from exporting a dataset or performing a financial action. Model the resource attributes needed for each decision, including tenant, business unit, classification, state, and ownership.

Use roles to group stable responsibilities, then apply attributes or relationships for context. An approver role does not necessarily authorize every invoice in every region. Default to denial when required context is missing, and record which trusted system provides each attribute. User supplied request fields cannot establish their own authority.

Evaluate the complete policy at execution

For invoice approval, require an active identity, tenant membership, an approver role, a permitted business unit, and an amount within the actor's approved limit. Separation of duties may also prevent the submitter from approving their own record. These are policy choices that must be confirmed with the business owner.

Evaluate permissions on the server for every protected operation, including bulk actions, exports, background jobs, and alternate API routes. Hiding a button improves usability but is not an access control. Recheck mutable resource state when executing the action so a prior UI decision does not become stale authorization.

ConditionTrusted inputFailure result
Active identityIdentity or session serviceDeny access
Tenant membershipMembership storeDeny resource access
Approval authorityRole and policy attributesDeny action
Current invoice stateAuthoritative resourceRequire renewed review

Treat policy as a versioned system

Keep policy definitions reviewable and assign owners. A policy change can affect many routes and jobs, so test its impact using representative decision requests before activation. Include a policy version in decision telemetry to make an access regression traceable without logging sensitive resource content.

Cache authorization results only within a defined validity model. Revocation, resource reassignment, and tenant switching must invalidate or bypass stale decisions. An outage of the policy service needs explicit behavior. High risk writes should not become permitted because a dependency failed; any limited fallback must be intentionally designed and audited.

Test denied access

Build a matrix of actors, actions, resources, and expected decisions. Include guessed identifiers, cross tenant resource references, stale roles, suspended accounts, missing attributes, and bulk requests containing one unauthorized item. Test through the external interface so middleware and resource lookup behavior are included.

Check that denial responses do not leak whether another tenant's resource exists. Preserve useful internal diagnostics under restricted access. Review privileged support and emergency access separately, with time bounds and accountability. A clear explanation of why access is denied helps operations without weakening the boundary that caused the denial.

References