class AnnotationLabelPolicy 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

__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
update(User$user,AnnotationLabel$annotationLabel)

Determine if the user can edit the given annotation label.

bool
destroy(User$user,AnnotationLabel$annotationLabel)

Determine if the user can delete the given annotation label.

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

Intercept all checks.

Parameters

User $user
string $ability

Return Value

bool|null

at line40
bool update(User$user,AnnotationLabel$annotationLabel)

Determine if the user can edit the given annotation label.

If the user created the annotation label, they must be editor or admin of one of the projects, the annotation belongs to. If another user created it, they must be admin of one of the projects.

Parameters

User $user
AnnotationLabel $annotationLabel

Return Value

bool

at line85
bool destroy(User$user,AnnotationLabel$annotationLabel)

Determine if the user can delete the given annotation label.

If the user created the annotation label, they must be editor or admin of one of the projects, the annotation belongs to. If another user created it, they must be admin of one of the projects.

Parameters

User $user
AnnotationLabel $annotationLabel

Return Value

bool