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

QueryBuilder
getBaseQuery(User$user,Project$project)

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

Determine if the given user can create projects.

Parameters

User $user

Return Value

bool

at line47
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 line61
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 line81
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 line98
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 line122
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 line138
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 line151
protectedQueryBuilder getBaseQuery(User$user,Project$project)

Get the base query for all policy methods.

Parameters

User $user
Project $project

Return Value

QueryBuilder