PrincipalVoter

abstract class \TYPO3\CMS\Core\Security\Authorization\Voter\PrincipalVoter

Extends
Voter

Base class of voters deciding for a Principal: the one of the request, or the one given to isGrantedForUser(). A request without principal, e.g. of an anonymous visitor, is denied once the voter supports the attribute and subject.

Implement supports() to state which attribute and subject the voter decides, and voteOnPrincipal() to decide. Overriding supportsAttribute() and supportsType() lets the access decision manager skip the voter without calling supports().

Tags

template
template
extends

Table of Contents

Methods

hasRole()  : bool
voteOnAttribute()  : bool
voteOnPrincipal()  : bool

Methods

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 abstract voteOnPrincipal(TAttribute $attribute, TSubject $subject, Principal $principal[, Vote|null $vote = null ]) : bool

Parameters

$attribute : TAttribute
$subject : TSubject
$principal : Principal
$vote : Vote|null = null

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

Return values

bool
On this page