VolumeFilePolicy
class VolumeFilePolicy extends CachedPolicy
Traits
Constants
TIME |
Time to store the cached values. (is irrelevant for the array store) |
Properties
protected Cache | $cache | The cache instance to use for caching policies. |
from CachedPolicy |
Methods
Wrapper for the Cache::remember function of the array cache.
Determine if the user can add an annotation to given file.
Determine if the user can attach the given label to the given file.
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.
at line 25
bool|null
before(User $user, string $ability)
Intercept all checks.
at line 41
bool
access(User $user, VolumeFile $file)
Determine if the user can access the given file.
at line 56
bool
addAnnotation(User $user, VolumeFile $file)
Determine if the user can add an annotation to given file.
at line 74
bool
destroy(User $user, VolumeFile $file)
Determine if the user can delete the given file.
at line 95
bool
attachLabel(User $user, VolumeFile $file, Label $label)
Determine if the user can attach the given label to the given file.
The file must belong to a project where the user is an editor or admin. The label must belong to a label tree that is used by one of the projects the user and the file belong to.