class StorageRequestPolicy extends CachedPolicy

Traits

HandlesAuthorization

Constants

TIME

Time to store the cached values.

(is irrelevant for the array store)

Properties

protected Repository $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
create(User $user)

Determine if the given user can create a new request.

bool
access(User $user, StorageRequest $request)

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

bool
update(User $user, StorageRequest $request)

Determine if the given user can update the storage request.

bool
approve(User $user, StorageRequest $request)

Determine if the given user can approve the storage request.

bool
reject(User $user, StorageRequest $request)

Determine if the given user can reject the storage request.

bool
destroy(User $user, StorageRequest $request)

Determine if the given user can destroy the storage request.

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

Intercept all checks.

Parameters

User $user
string $ability

Return Value

bool|null

at line 38
bool create(User $user)

Determine if the given user can create a new request.

Parameters

User $user

Return Value

bool

at line 54
bool access(User $user, StorageRequest $request)

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

Parameters

User $user
StorageRequest $request

Return Value

bool

at line 67
bool update(User $user, StorageRequest $request)

Determine if the given user can update the storage request.

Parameters

User $user
StorageRequest $request

Return Value

bool

at line 84
bool approve(User $user, StorageRequest $request)

Determine if the given user can approve the storage request.

Parameters

User $user
StorageRequest $request

Return Value

bool

at line 98
bool reject(User $user, StorageRequest $request)

Determine if the given user can reject the storage request.

Parameters

User $user
StorageRequest $request

Return Value

bool

at line 111
bool destroy(User $user, StorageRequest $request)

Determine if the given user can destroy the storage request.

Parameters

User $user
StorageRequest $request

Return Value

bool