RecordAccessVoter

class \TYPO3\CMS\Core\Domain\Access\RecordAccessVoter

Checks if a record can be accessed (usually in TYPO3 Frontend) due to various "enableFields" or group access checks.

Not related to "write permissions" etc.

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Properties

$eventDispatcher  : EventDispatcherInterface

Methods

__construct()  : mixed
accessGranted()  : bool
Checks page record for enableFields Returns TRUE if enableFields does not disable the page record.
accessGrantedForPageInRootLine()  : bool
Checks if the current page of the root line is visible.
groupAccessGranted()  : bool
Check group access against a record, if the current users' groups match the fe_group values of the record.
getEnableFieldsConfigurationForTable()  : array

Properties

$eventDispatcher read-only

protected EventDispatcherInterface $eventDispatcher

Methods

__construct()

public __construct(EventDispatcherInterface $eventDispatcher) : mixed

Parameters

$eventDispatcher : EventDispatcherInterface

accessGranted()

Checks page record for enableFields Returns TRUE if enableFields does not disable the page record.

public accessGranted(string $table, array $record, Context $context) : bool

Takes notice of the includeHiddenPages visibility aspect flag and uses SIM_ACCESS_TIME for start/endtime evaluation

Parameters

$table : string

the TCA table to check for

$record : array

The record to evaluate (needs fields: hidden, starttime, endtime, fe_group)

$context : Context

Context API to check against

Return values

bool —

TRUE, if record is viewable.

accessGrantedForPageInRootLine()

Checks if the current page of the root line is visible.

public accessGrantedForPageInRootLine(array $pageRecord, Context $context) : bool

If the field extendToSubpages is 0, access is granted, else the fields hidden, starttime, endtime, fe_group are evaluated.

Parameters

$pageRecord : array
$context : Context

Return values

bool

groupAccessGranted()

Check group access against a record, if the current users' groups match the fe_group values of the record.

public groupAccessGranted(string $table, array $record, Context $context) : bool

Parameters

$table : string

the TCA table to check for

$record : array

The record to evaluate (needs enableField: fe_group)

$context : Context

Context API to check against

Return values

bool —

TRUE, if group access is granted.

getEnableFieldsConfigurationForTable()

protected getEnableFieldsConfigurationForTable(string $table) : array

Parameters

$table : string

Return values

array
On this page