abstract class AbstractPolicy

Constants

GLOBAL

ALLOW

DENY

FORCE_ALLOW

FORCE_DENY

Methods

allow()

No description

deny()

No description

forceAllow()

No description

forceDeny()

No description

string|void
checkAbility(User $actor, string $ability, $instance)

No description

string|void
sanitizeResult(mixed $result)

Allows `true` to be used in place of `->allow()`, and `false` instead of `->deny()` This allows more concise and intuitive code, by returning boolean statements:.

Details

protected allow()

protected deny()

protected forceAllow()

protected forceDeny()

string|void checkAbility(User $actor, string $ability, $instance)

Parameters

User $actor
string $ability
$instance

Return Value

string|void

string|void sanitizeResult(mixed $result)

Allows `true` to be used in place of `->allow()`, and `false` instead of `->deny()` This allows more concise and intuitive code, by returning boolean statements:.

WITHOUT THIS: `return SOME_BOOLEAN_LOGIC ? $this->allow() : $this->deny(); WITH THIS: `return SOME_BOOLEAN_LOGIC;

Parameters

mixed $result

Return Value

string|void