Documentation

SecurityVoter extends Voter
in package

FinalYes

Voter is an abstract default implementation of a voter.

Table of Contents

Properties

$adminContextProvider  : AdminContextProvider
$authorizationChecker  : AuthorizationCheckerInterface

Methods

__construct()  : mixed
supportsAttribute()  : bool
Return false if your voter doesn't support the given attribute. Symfony will cache that decision and won't call your voter again for that attribute.
supportsType()  : bool
Return false if your voter doesn't support the given subject type. Symfony will cache that decision and won't call your voter again for that subject type.
vote()  : int
Returns the vote for the given parameters.
supports()  : bool
Determines if the attribute and subject are supported by this voter.
voteOnAttribute()  : bool
Perform a single access check operation on a given attribute, subject and token.
voteOnExecuteActionPermission()  : bool
voteOnExitImpersonationPermission()  : bool
voteOnViewEntityPermission()  : bool
voteOnViewMenuItemPermission()  : bool
voteOnViewPropertyPermission()  : bool

Properties

Methods

supportsAttribute()

Return false if your voter doesn't support the given attribute. Symfony will cache that decision and won't call your voter again for that attribute.

public supportsAttribute(string $attribute) : bool
Parameters
$attribute : string
Return values
bool

supportsType()

Return false if your voter doesn't support the given subject type. Symfony will cache that decision and won't call your voter again for that subject type.

public supportsType(string $subjectType) : bool
Parameters
$subjectType : string

The type of the subject inferred by get_class() or get_debug_type()

Return values
bool

vote()

Returns the vote for the given parameters.

public vote(TokenInterface $token, mixed $subject, array<string|int, mixed> $attributes) : int
Parameters
$token : TokenInterface
$subject : mixed

The subject to secure

$attributes : array<string|int, mixed>

An array of attributes associated with the method being invoked

Return values
int

either ACCESS_GRANTED, ACCESS_ABSTAIN, or ACCESS_DENIED

supports()

Determines if the attribute and subject are supported by this voter.

protected supports(string $permissionName, mixed $subject) : bool
Parameters
$permissionName : string
$subject : mixed

The subject to secure, e.g. an object the user wants to access or any other PHP type

Return values
bool

voteOnAttribute()

Perform a single access check operation on a given attribute, subject and token.

protected voteOnAttribute(mixed $permissionName, mixed $subject, TokenInterface $token) : bool

It is safe to assume that $attribute and $subject already passed the "supports()" method check.

Parameters
$permissionName : mixed
$subject : mixed
$token : TokenInterface
Return values
bool

voteOnExitImpersonationPermission()

private voteOnExitImpersonationPermission() : bool
Return values
bool

voteOnViewPropertyPermission()

private voteOnViewPropertyPermission(FieldDto $field) : bool
Parameters
$field : FieldDto
Return values
bool

        
On this page

Search results