interface PermissionChecker (View source)

Calculates edit / view / delete permissions for one or more objects

Methods

public
array
canEditMultiple(array $ids, Member $member = null, bool $useCached = true)

Get the 'can edit' information for a number of SiteTree pages.

public
mixed
canViewMultiple(array $ids, Member $member = null, bool $useCached = true)

Get the canView information for a number of objects

public
array
canDeleteMultiple(array $ids, Member $member = null, bool $useCached = true)

Get the 'can edit' information for a number of SiteTree pages.

public
bool
canDelete(int $id, Member $member = null)

Check delete permission for a single record ID

public
bool
canEdit(int $id, Member $member = null)

Check edit permission for a single record ID

public
bool
canView(int $id, Member $member = null)

Check view permission for a single record ID

Details

array canEditMultiple(array $ids, Member $member = null, bool $useCached = true)

Get the 'can edit' information for a number of SiteTree pages.

Parameters

array $ids

An array of IDs of the objects to look up

Member $member

Member object

bool $useCached

Return values from the permission cache if they exist

Return Value

array

A map where the IDs are keys and the values are booleans stating whether the given object can be edited

mixed canViewMultiple(array $ids, Member $member = null, bool $useCached = true)

Get the canView information for a number of objects

Parameters

array $ids
Member $member
bool $useCached

Return Value

mixed

array canDeleteMultiple(array $ids, Member $member = null, bool $useCached = true)

Get the 'can edit' information for a number of SiteTree pages.

Parameters

array $ids

An array of IDs of the objects pages to look up

Member $member

Member object

bool $useCached

Return values from the permission cache if they exist

Return Value

array

bool canDelete(int $id, Member $member = null)

Check delete permission for a single record ID

Parameters

int $id
Member $member

Return Value

bool

bool canEdit(int $id, Member $member = null)

Check edit permission for a single record ID

Parameters

int $id
Member $member

Return Value

bool

bool canView(int $id, Member $member = null)

Check view permission for a single record ID

Parameters

int $id
Member $member

Return Value

bool