Skip to content
docsv0.9.0

PermissionCatalog

The dictionary of what CAN exist: the permissions an application declares and the roles that bundle them. It is the Admin-readiness seam for browsing the matrix, and the source the resolver expands a role id against. Ships with an in-memory default ({@see \Milpa\Auth\ArrayPermissionCatalog}); a host may back it with anything, but the leaf never assumes a database.

PermissionCatalog::permissions()

abstract public function permissions(): array

The full permission dictionary.

Returns

the full permission dictionary

PermissionCatalog::roles()

abstract public function roles(): array

All roles declared in this catalog.

PermissionCatalog::role()

abstract public function role(string $id): ?Milpa\Auth\Role

The role with this id, or null when unknown (an unknown role grants nothing — fail-closed).

Parameters

Parameters of role()
NameTypeDescription
$idstring