class VolumePolicy extends CachedPolicy

Traits

HandlesAuthorization

Constants

TIME

Time to store the cached values.

(is irrelevant for the array store)

Properties

protected Cache $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

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.

Parameters

string $key Key of the cached item
callable $callback Callback returning the cached item

Return Value

mixed

at line 22
bool|null before(User $user, string $ability)

Intercept all checks.

Parameters

User $user
string $ability

Return Value

bool|null

at line 36
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 line 50
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 line 70
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 line 86
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 line 102
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 line 115
protected QueryBuilder getBaseQuery(User $user, Volume $volume)

Get the base query for all policy methods.

Parameters

User $user
Volume $volume

Return Value

QueryBuilder