Laminas Permissions ACL
Role-based access control lists for PHP applications.
Repository Health
Technical Analysis
Laminas Permissions ACL provides a lightweight, flexible implementation of access control lists (ACL) for PHP. It lets you model authorization as roles, resources, and privileges, then query whether a given role is allowed to perform an action on a resource.
Roles and resources support inheritance, and rules can be layered with allow/deny semantics and assertion callbacks for context-sensitive decisions. As part of the Laminas project (formerly Zend Framework), it is a mature, well-documented building block for application authorization.
What You Get
- An
AclAPI for defining roles, resources, and privileges - Allow/deny rules with role and resource inheritance
- Assertion interface for context-sensitive authorization checks
- A simple
isAllowed()query for authorization decisions
Common Use Cases
- Enforcing role-based permissions across an application’s actions
- Modeling hierarchical roles such as guest, member, and admin
- Applying dynamic authorization rules via custom assertions
Under The Hood
Architecture - The Acl class maintains registries of Role and Resource objects (each supporting parent references for inheritance) and a rules table keyed by role, resource, and privilege. isAllowed() walks the inheritance chains applying the most specific matching allow/deny rule, and optionally invokes an AssertionInterface for dynamic checks. Tech Stack - Modern PHP (8.x) organized under the Laminas\Permissions\Acl namespace with PSR-4 autoloading, PHPUnit tests, and PHPStan/psalm static analysis in CI. Code Quality - Long-lived, high-coverage code inherited from Zend Framework with continuous-integration workflows and strict typing; well-documented on docs.laminas.dev. API Design - Clear and composable: addRole(), addResource(), allow(), deny(), and isAllowed() read almost like a specification of your permission model.