ModuleVoter

final class \TYPO3\CMS\Backend\Security\Authorization\ModuleVoter

Extends
PrincipalVoter

Decides on accessing a backend module with one of the access values of TYPO3 Core: isGranted(Scope::ACCESS, $moduleRegistry->getModule('web_layout')).

A principal of a frontend user is denied every module. For backend users, no access value grants every backend user, "admin" and "systemMaintainer" require the corresponding role, "user" a grant of the module or one of its aliases in the group data of the backend user object the principal was built from, as BackendUserAuthentication::check() does. Without such an object, "user" is denied.

An access value of TYPO3 Core whose module access gate an extension replaced is decided by that gate through the ModuleAccessGateVoter.

The access value of a module is no closed set: an extension may use a value of its own and decide it with a voter, or with a module access gate, which is asked by the ModuleAccessGateVoter. A module whose access value no voter decides is not accessible. The workspace restriction of a module is decided by the ModuleWorkspaceVoter, as it depends on the current workspace instead of a grant.

Tags

extends

Attributes

#[AsSecurityVoter]

Table of Contents

Constants

ACCESS_VALUES  : array = ['', 'user', 'admin', 'systemMaintainer']
The access values of TYPO3 Core, decided by this voter

Methods

__construct()  : mixed
supportsAttribute()  : bool
supportsType()  : bool
hasRole()  : bool
supports()  : bool
voteOnAttribute()  : bool
voteOnPrincipal()  : bool

Constants

ACCESS_VALUES

The access values of TYPO3 Core, decided by this voter

public array ACCESS_VALUES = ['', 'user', 'admin', 'systemMaintainer']

Methods

supportsAttribute()

public supportsAttribute(string $attribute) : bool

Parameters

$attribute : string

Return values

bool

supportsType()

public supportsType(string $subjectType) : bool

Parameters

$subjectType : string

Return values

bool

supports()

protected supports(string $attribute, mixed $subject) : bool

Parameters

$attribute : string
$subject : mixed

Return values

bool

voteOnAttribute()

protected final voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token[, Vote|null $vote = null ]) : bool

Parameters

$attribute : string
$subject : mixed
$token : TokenInterface
$vote : Vote|null = null

Return values

bool

voteOnPrincipal()

protected voteOnPrincipal(string $attribute, mixed $subject, Principal $principal[, Vote|null $vote = null ]) : bool

Parameters

$attribute : string
$subject : mixed
$principal : Principal
$vote : Vote|null = null

Collects the reasons of the decision, see Vote::addReason()

Return values

bool
On this page