class UserPolicy extends AbstractPolicy

Constants

GLOBAL

ALLOW

DENY

FORCE_ALLOW

FORCE_DENY

Methods

string
allow()

No description

string
deny()

No description

string
forceAllow()

No description

string
forceDeny()

No description

string|null
checkAbility(User $actor, string $ability, AbstractModel|null $instance)

No description

string|null
sanitizeResult(string|bool|null $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:.

string|null
can(User $actor, string $ability)

No description

string|null
editCredentials(User $actor, User $user)

No description

Details

protected string allow()

Return Value

string

protected string deny()

Return Value

string

protected string forceAllow()

Return Value

string

protected string forceDeny()

Return Value

string

string|null checkAbility(User $actor, string $ability, AbstractModel|null $instance)

Parameters

User $actor
string $ability
AbstractModel|null $instance

Return Value

string|null

string|null sanitizeResult(string|bool|null $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

string|bool|null $result

Return Value

string|null

string|null can(User $actor, string $ability)

Parameters

User $actor
string $ability

Return Value

string|null

string|null editCredentials(User $actor, User $user)

Parameters

User $actor
User $user

Return Value

string|null