class LabelTreePolicy extends CachedPolicy

Traits

HandlesAuthorization

Constants

TIME

Time to store the cached values.

(is irrelevant for the array store)

TABLE

Properties

protected Repository $cache

The cache instance to use for caching policies.

from  CachedPolicy

Methods

__construct()

Create a new CachedPolicy.

mixed
remember(string $key, callable $callback)

Wrapper for the Cache::remember function of the array cache.

bool|null
before(User $user, string $ability)

Intercept all checks.

bool
create(User $user)

Determine if the given user can create label trees.

bool
access(User $user, LabelTree $tree)

Determine if the given label tree can be accessed by the user.

bool
createLabel(User $user, LabelTree $tree)

Determine if the user can add labels to the given label tree.

bool
update(User $user, LabelTree $tree)

Determine if the given label tree can be updated by the user.

bool
destroy(User $user, LabelTree $tree)

Determine if the given label tree can be deleted by the user.

bool
addMember(User $user, LabelTree $tree)

Determine if the user can add members to the given label tree.

bool
updateMember(User $user, LabelTree $tree, User $member)

Determine if the user can update the given member of the given label tree.

bool
removeMember(User $user, LabelTree $tree, User $member)

Determine if the user can remove the given member from the given label tree.

Details

in CachedPolicy at line 31
__construct()

Create a new CachedPolicy.

in CachedPolicy at line 43
mixed remember(string $key, callable $callback)

Wrapper for the Cache::remember function of the array cache.

Parameters

string $key

Key of the cached item

callable $callback

Callback returning the cached item

Return Value

mixed

at line 25
bool|null before(User $user, string $ability)

Intercept all checks.

Parameters

User $user
string $ability

Return Value

bool|null

at line 40
bool create(User $user)

Determine if the given user can create label trees.

Parameters

User $user

Return Value

bool

at line 52
bool access(User $user, LabelTree $tree)

Determine if the given label tree can be accessed by the user.

Parameters

User $user
LabelTree $tree

Return Value

bool

at line 80
bool createLabel(User $user, LabelTree $tree)

Determine if the user can add labels to the given label tree.

Parameters

User $user
LabelTree $tree

Return Value

bool

at line 102
bool update(User $user, LabelTree $tree)

Determine if the given label tree can be updated by the user.

Parameters

User $user
LabelTree $tree

Return Value

bool

at line 124
bool destroy(User $user, LabelTree $tree)

Determine if the given label tree can be deleted by the user.

Parameters

User $user
LabelTree $tree

Return Value

bool

at line 136
bool addMember(User $user, LabelTree $tree)

Determine if the user can add members to the given label tree.

Parameters

User $user
LabelTree $tree

Return Value

bool

at line 149
bool updateMember(User $user, LabelTree $tree, User $member)

Determine if the user can update the given member of the given label tree.

Parameters

User $user
LabelTree $tree
User $member

Return Value

bool

at line 165
bool removeMember(User $user, LabelTree $tree, User $member)

Determine if the user can remove the given member from the given label tree.

Every member can remove themselves. Otherwise only admins are allowed to remove members.

Parameters

User $user
LabelTree $tree
User $member

Return Value

bool