Problem
Hard-coded permission checks scatter across services and drift from business rules. Pure roles explode in number as requirements grow, while ad hoc conditions become unauditable.
Also known as: role-based-access-control, attribute-based-access-control, policy-based-authorization
Choose and implement an authorization model that grants access by role for simplicity or by attributes and context for fine-grained control.
Hard-coded permission checks scatter across services and drift from business rules. Pure roles explode in number as requirements grow, while ad hoc conditions become unauditable.
RBAC answers whether a user holds a role that carries a permission. ABAC answers whether the attributes of the subject, resource, action and environment satisfy a policy. Most production systems use roles for coarse access and attributes for the exceptions.
A pragmatic path is to model permissions as verbs on resource types, bundle them into a handful of roles, and add attribute conditions only for tenant, ownership and sensitivity rules. Run decision logs in shadow mode when changing policies so you can compare old and new outcomes before enforcing.
PEP (service) -> PDP: { subject: {id, roles, dept},
action: "read",
resource: {type: "invoice", owner: "u7", tenant: "t1"},
env: {ip, time} }
PDP evaluates policy:
allow if "finance" in subject.roles
and resource.tenant == subject.tenant
PDP -> PEP: allow | deny (+ reason for audit log)
The enforcement point is called in every service; the decision logic lives in versioned policy files evaluated locally or by a sidecar.
Low to medium — policy engine sidecar or service
Medium — policy lifecycle and testing
Medium to high
Stale attributes grant access after a user changes teams
Policy engine outage causes fail-open or global denial
Role explosion makes least privilege unreviewable