PHP Класс Symfony\Component\Security\Authorization\AccessDecisionManager

Автор: Fabien Potencier ([email protected])
Наследование: implements Symfony\Component\Security\Authorization\AccessDecisionManagerInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$allowIfAllAbstainDecisions
$allowIfEqualGrantedDeniedDecisions
$strategy
$voters

Открытые методы

Метод Описание
__construct ( array $voters = [], string $strategy = 'affirmative', boolean $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true ) Constructor.
addVoter ( Symfony\Component\Security\Authorization\Voter\VoterInterface $voter ) Adds a voter.
decide ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null )
decideConsensus ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null ) Grants access if there is consensus of granted against denied responses.
decideUnanimous ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null ) Grants access if only grant (or abstain) votes were received.
getVoters ( ) : Symfony\Component\Security\Authorization\Voter\VoterInterface[] Returns all voters.
setVoters ( array $voters ) Sets voters.
supportsAttribute ( $attribute )
supportsClass ( $class )

Защищенные методы

Метод Описание
decideAffirmative ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null ) Grants access if any voter returns an affirmative response.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $voters = [], string $strategy = 'affirmative', boolean $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true )
$voters array An array of VoterInterface instances
$strategy string The vote strategy
$allowIfAllAbstainDecisions boolean Whether to grant access if all voters abstained or not

addVoter() публичный Метод

Adds a voter.
public addVoter ( Symfony\Component\Security\Authorization\Voter\VoterInterface $voter )
$voter Symfony\Component\Security\Authorization\Voter\VoterInterface A VoterInterface instance

decide() публичный Метод

public decide ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null )
$token Symfony\Component\Security\Authentication\Token\TokenInterface
$attributes array

decideAffirmative() защищенный Метод

If all voters abstained from voting, the decision will be based on the allowIfAllAbstainDecisions property value (defaults to false).
protected decideAffirmative ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null )
$token Symfony\Component\Security\Authentication\Token\TokenInterface
$attributes array

decideConsensus() публичный Метод

Consensus means majority-rule (ignoring abstains) rather than unanimous agreement (ignoring abstains). If you require unanimity, see UnanimousBased. If there were an equal number of grant and deny votes, the decision will be based on the allowIfEqualGrantedDeniedDecisions property value (defaults to true). If all voters abstained from voting, the decision will be based on the allowIfAllAbstainDecisions property value (defaults to false).
public decideConsensus ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null )
$token Symfony\Component\Security\Authentication\Token\TokenInterface
$attributes array

decideUnanimous() публичный Метод

If all voters abstained from voting, the decision will be based on the allowIfAllAbstainDecisions property value (defaults to false).
public decideUnanimous ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null )
$token Symfony\Component\Security\Authentication\Token\TokenInterface
$attributes array

getVoters() публичный Метод

Returns all voters.
public getVoters ( ) : Symfony\Component\Security\Authorization\Voter\VoterInterface[]
Результат Symfony\Component\Security\Authorization\Voter\VoterInterface[] $voters An array of VoterInterface instances

setVoters() публичный Метод

Sets voters.
public setVoters ( array $voters )
$voters array An array of VoterInterface instances

supportsAttribute() публичный Метод

public supportsAttribute ( $attribute )

supportsClass() публичный Метод

public supportsClass ( $class )

Описание свойств

$allowIfAllAbstainDecisions защищенное свойство

protected $allowIfAllAbstainDecisions

$allowIfEqualGrantedDeniedDecisions защищенное свойство

protected $allowIfEqualGrantedDeniedDecisions

$strategy защищенное свойство

protected $strategy

$voters защищенное свойство

protected $voters