ModuleVoter
final class \
- 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
Attributes
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
__construct()
public
__construct(LegacyBackendUserRegistry $legacyUserRegistry, ReplacedModuleAccessGates $replacedGates) : mixed
Parameters
- $legacyUserRegistry : LegacyBackendUserRegistry
- $replacedGates : ReplacedModuleAccessGates
supportsAttribute()
public
supportsAttribute(string $attribute) : bool
Parameters
- $attribute : string
Return values
boolsupportsType()
public
supportsType(string $subjectType) : bool
Parameters
- $subjectType : string
Return values
boolhasRole()
protected
final hasRole(Principal $principal, SecurityRole $role) : bool
Parameters
- $principal : Principal
- $role : SecurityRole
Return values
boolsupports()
protected
supports(string $attribute, mixed $subject) : bool
Parameters
- $attribute : string
- $subject : mixed
Return values
boolvoteOnAttribute()
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
boolvoteOnPrincipal()
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()