Documentation

VoterInterface

VoterInterface is the interface implemented by all voters.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

Constants

ACCESS_ABSTAIN  = 0
ACCESS_DENIED  = -1
ACCESS_GRANTED  = 1

Methods

vote()  : int
Returns the vote for the given parameters.

Constants

Methods

vote()

Returns the vote for the given parameters.

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

This method must return one of the following constants: ACCESS_GRANTED, ACCESS_DENIED, or ACCESS_ABSTAIN.

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


        
On this page

Search results