mini\Authorizer\Authorization::guard() Method

public

Signature

public function guard(string $resource): mini\Hooks\Handler

Parameters

Name Type Default Description
$resource string required Documentation missing

Returns

mini\Hooks\Handler

Documentation

Get or create guard for a specific resource

Guards run BEFORE normal handlers and can only deny (return false) or pass (return null). Use guards for cross-cutting security concerns like tenant isolation.

Guards follow the same type specificity as handlers but run in a separate phase:

  1. All guards are checked first (can deny)
  2. Then normal handlers are checked (can allow or deny)

Source

src/Authorizer/Authorization.php:87-90