class ProjectPolicy 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 projects.

bool
access(User $user, Project $project)

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

bool
editIn(User $user, Project $project)

Determine if the user can edit things in the given project.

bool
forceEditIn(User $user, Project $project)

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

bool
removeMember(User $user, Project $project, User $member)

Determine if user can remove the given project member from the given project.

bool
update(User $user, Project $project)

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

bool
destroy(User $user, Project $project)

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

Builder
getBaseQuery(User $user, Project $project)

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 37
bool create(User $user)

Determine if the given user can create projects.

Parameters

User $user

Return Value

bool

at line 49
bool access(User $user, Project $project)

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

Parameters

User $user
Project $project

Return Value

bool

at line 61
bool editIn(User $user, Project $project)

Determine if the user can edit things in the given project.

Parameters

User $user
Project $project

Return Value

bool

at line 81
bool forceEditIn(User $user, Project $project)

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

Parameters

User $user
Project $project

Return Value

bool

at line 98
bool removeMember(User $user, Project $project, User $member)

Determine if user can remove the given project member from the given project.

Parameters

User $user
Project $project
User $member

Return Value

bool

at line 122
bool update(User $user, Project $project)

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

Parameters

User $user
Project $project

Return Value

bool

at line 138
bool destroy(User $user, Project $project)

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

Parameters

User $user
Project $project

Return Value

bool

at line 151
protected Builder getBaseQuery(User $user, Project $project)

Get the base query for all policy methods.

Parameters

User $user
Project $project

Return Value

Builder