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 <code>true</code> to be used in place of <code>-&gt;allow()</code>, and <code>false</code> instead of <code>-&gt;deny()</code> 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 <code>true</code> to be used in place of <code>-&gt;allow()</code>, and <code>false</code> instead of <code>-&gt;deny()</code> This allows more concise and intuitive code, by returning boolean statements:.

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

Parameters

mixed $result

Return Value

string|void