Skip to content
docsv0.9.0

PermissionReport

A snapshot of what an actor can do in a context and WHY — actor, context, the roles it holds, and the resolved {@see PermissionSet} carrying per-permission provenance. The Admin-readiness seam. It answers "what / why / from where", never "why did this specific action fail" (that is per-check, and lives in {@see Exceptions\PermissionDeniedException}). Carries no denied/warnings and no timestamp.

PermissionReport::__construct()

public function __construct(Milpa\Auth\Actor $actor, Milpa\Auth\PermissionContext $context, array $roles, Milpa\Auth\PermissionSet $granted):

Constructor for a permission report.

Parameters

Parameters of __construct()
NameTypeDescription
$actorMilpa\Auth\Actor
$contextMilpa\Auth\PermissionContext
$roleslist<string>the role ids the actor holds
$grantedMilpa\Auth\PermissionSet

PermissionReport::of()

public static function of(Milpa\Auth\Actor $actor, Milpa\Auth\PermissionContext $context, Milpa\Auth\Contracts\PermissionResolver $resolver): self

Create a permission report from an actor, context, and permission resolver.

Parameters

Parameters of of()
NameTypeDescription
$actorMilpa\Auth\Actor
$contextMilpa\Auth\PermissionContext
$resolverMilpa\Auth\Contracts\PermissionResolver