class VolumePolicy 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,Volume$volume)

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

bool
editIn(User$user,Volume$volume)

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

bool
forceEditIn(User$user,Volume$volume)

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

bool
update(User$user,Volume$volume)

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

bool
destroy(User$user,Volume$volume)

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

QueryBuilder
getBaseQuery(User$user,Volume$volume)

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

Intercept all checks.

Parameters

User $user
string $ability

Return Value

bool|null

at line36
bool access(User$user,Volume$volume)

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

Parameters

User $user
Volume $volume

Return Value

bool

at line50
bool editIn(User$user,Volume$volume)

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

Parameters

User $user
Volume $volume

Return Value

bool

at line70
bool forceEditIn(User$user,Volume$volume)

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

Parameters

User $user
Volume $volume

Return Value

bool

at line86
bool update(User$user,Volume$volume)

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

Parameters

User $user
Volume $volume

Return Value

bool

at line102
bool destroy(User$user,Volume$volume)

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

Parameters

User $user
Volume $volume

Return Value

bool

at line115
protectedQueryBuilder getBaseQuery(User$user,Volume$volume)

Get the base query for all policy methods.

Parameters

User $user
Volume $volume

Return Value

QueryBuilder