Skip to content
docsv0.9.0

CatalogPermissionResolver

The reference {@see PermissionResolver}: lifts each flat scope into a {@see GrantedPermission} (scope provenance), expands each role via the {@see PermissionCatalog} (role provenance), and preserves the `'*'` grant. Fail-closed: an unknown role grants nothing, and a scope that is not a valid permission key is skipped from the set (it stays checkable via {@see Actor::hasScope()}). Intentionally tenant-blind — it threads {@see PermissionContext} through without interpreting it, so a tenant-aware host or a {@see Contracts\Policy} can decide without a breaking change.

CatalogPermissionResolver::__construct()

public function __construct(Milpa\Auth\Contracts\PermissionCatalog $catalog):

Parameters

Parameters of __construct()
NameTypeDescription
$catalogMilpa\Auth\Contracts\PermissionCatalog

CatalogPermissionResolver::resolve()

public function resolve(Milpa\Auth\Actor $actor, Milpa\Auth\PermissionContext $context): Milpa\Auth\PermissionSet

Lifts $actor's flat scopes and expands its roles via the catalog into a {@see PermissionSet}. $context is threaded but intentionally unused — this default resolver is tenant-blind.

Parameters

Parameters of resolve()
NameTypeDescription
$actorMilpa\Auth\Actor
$contextMilpa\Auth\PermissionContext