AnnotationCandidatePolicy
class AnnotationCandidatePolicy extends CachedPolicy
Traits
Constants
TIME |
Time to store the cached values. (is irrelevant for the array store) |
Properties
protected Repository | $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 given annotation candidate can be accessed by the user.
Determine if the given user can update the annotation candidate.
Determine if the user can attach the given label to the given candidate.
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, AnnotationCandidate $candidate)
Determine if the given annotation candidate can be accessed by the user.
at line 71
bool
update(User $user, AnnotationCandidate $candidate)
Determine if the given user can update the annotation candidate.
at line 88
bool
attachLabel(User $user, AnnotationCandidate $candidate, Label $label)
Determine if the user can attach the given label to the given candidate.
The candidate (image) 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 candidate belong to.