class VideoPolicy 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
access(User$user,Video$video)

Determine if the given video can be accessed by the user.

bool
editIn(User$user,Video$video)

Determine if the user can edit something in the given video.

bool
forceEditIn(User$user,Video$video)

Determine if the user can edit things created by other users in the given video.

bool
update(User$user,Video$video)

Determine if the given video can be updated by the user.

bool
destroy(User$user,Video$video)

Determine if the given video can be deleted by the user.

QueryBuilder
getBaseQuery(User$user,Video$video)

Get the base query for all policy methods.

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

Intercept all checks.

Parameters

User $user
string $ability

Return Value

bool|null

at line37
bool access(User$user,Video$video)

Determine if the given video can be accessed by the user.

Parameters

User $user
Video $video

Return Value

bool

at line51
bool editIn(User$user,Video$video)

Determine if the user can edit something in the given video.

Parameters

User $user
Video $video

Return Value

bool

at line71
bool forceEditIn(User$user,Video$video)

Determine if the user can edit things created by other users in the given video.

Parameters

User $user
Video $video

Return Value

bool

at line87
bool update(User$user,Video$video)

Determine if the given video can be updated by the user.

Parameters

User $user
Video $video

Return Value

bool

at line103
bool destroy(User$user,Video$video)

Determine if the given video can be deleted by the user.

Parameters

User $user
Video $video

Return Value

bool

at line116
protectedQueryBuilder getBaseQuery(User$user,Video$video)

Get the base query for all policy methods.

Parameters

User $user
Video $video

Return Value

QueryBuilder