class Gate

Constants

EVALUATION_CRITERIA_PRIORITY

Properties

protected Container $container
protected array $policyClasses
protected array $policies

Methods

__construct(Container $container, array $policyClasses)

No description

bool
allows(User $actor, string $ability, string|AbstractModel $model)

<p>Determine if the given ability should be granted for the current user.</p>

getPolicies(string $model)

<p>Get all policies for a given model and ability.</p>

Details

__construct(Container $container, array $policyClasses)

Parameters

Container $container
array $policyClasses

bool allows(User $actor, string $ability, string|AbstractModel $model)

<p>Determine if the given ability should be granted for the current user.</p>

Parameters

User $actor
string $ability
string|AbstractModel $model

Return Value

bool

protected getPolicies(string $model)

<p>Get all policies for a given model and ability.</p>

Parameters

string $model