class LabelTreePolicy extendsCachedPolicy

Traits

HandlesAuthorization

Constants

TIME

Time to store the cached values.

(is irrelevant for the array store)

TABLE

Properties

protectedCache $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

inCachedPolicyat line31
__construct()

Create a new CachedPolicy.

inCachedPolicyat line43
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 line25
bool|null before(User$user,string$ability)

Intercept all checks.

Parameters

User $user
string $ability

Return Value

bool|null

at line40
bool create(User$user)

Determine if the given user can create label trees.

Parameters

User $user

Return Value

bool

at line52
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 line80
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 line102
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 line124
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 line136
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 line149
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 line167
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