ImagePolicy
class ImagePolicy extendsCachedPolicy
Traits
HandlesAuthorization
Constants
TIME |
Time to store the cached values. (is irrelevant for the array store) |
Properties
protectedCache | $cache | The cache instance to use for caching policies. | from CachedPolicy |
Methods
mixed
remember(string$key,callable$callback)
Wrapper for the Cache::remember function of the array cache.
from CachedPolicy
bool
bool
attachLabel(User$user,Image$image,Label$label)
Determine if the user can attach the given label to the given image.
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.
at line25
bool|null
before(User$user,string$ability)
Intercept all checks.
at line63
bool
addAnnotation(User$user,Image$image)
Determine if the user can add an annotation to given image.
at line120
bool
attachLabel(User$user,Image$image,Label$label)
Determine if the user can attach the given label to the given image.
The 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 image belong to.