PHP Framework
The AAM PHP framework stores access rules and resolves them for a user, role, visitor, or the default access level. Start with AAM::api(), choose a service, then write a rule or check a decision. AAM’s WordPress integrations apply many of these rules during normal requests; your custom code can use the same decisions.
$posts = AAM::api()->posts('role:subscriber');
$posts->deny(34, 'read');
if ($posts->is_restricted(34)) {
// Handle this decision in your own request flow.
}
The rule applies to Subscribers. The check reads the access decision for post 34; custom code must handle the result itself.
Choose a starting point
- Quick start — set a rule and check it.
- API gateway — select a service, subject, and error behavior.
- Services — methods for each resource or preference.
- Access levels — inheritance and subject selection.
- Framework objects — resources, preferences, proxies, and utilities.
How the pieces fit
| Piece | Job |
|---|---|
| Service | Provides task-focused methods such as deny(), is_denied(), or set_redirect(). |
| Access level | Identifies whose rules are read or written. |
| Resource | Stores permissions for posts, URLs, capabilities, and other resources. |
| Preference | Stores a choice such as a login redirect. |
| Proxy | Wraps a WordPress user or role for framework access levels. |
| Utility | Supports lower-level work such as configuration, caching, and JWT handling. |
Use a service for application code. Reach for a resource, preference, or utility when extending the framework itself.