class GroupPolicy 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, string| 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
delete( User $actor, Group $group)

The admin, guest and member groups are built in: core relies on them (`Guest`, `User::groups()`), so nobody may delete them, administrators included.

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, string| AbstractModel|null $instance)

Parameters

User $actor
string $ability
string| 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 delete( User $actor, Group $group)

The admin, guest and member groups are built in: core relies on them (`Guest`, `User::groups()`), so nobody may delete them, administrators included.

Parameters

User $actor
Group $group

Return Value

string|null