class Gate

Constants

EVALUATION_CRITERIA_PRIORITY

Properties

protected AbstractPolicy[] $policies

Methods

__construct( Container $container, array $policyClasses)

No description

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

Determine if the given ability should be granted for the current user.

array
getPolicies(string $model)

Get all policies for a given model and ability.

Details

__construct( Container $container, array $policyClasses)

Parameters

Container $container
array $policyClasses

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

Determine if the given ability should be granted for the current user.

Parameters

User $actor
string $ability
string| AbstractModel|null $model

Return Value

bool

protected array getPolicies(string $model)

Get all policies for a given model and ability.

Parameters

string $model

Return Value

array