PHP Class Symfony\Component\Security\Authorization\AccessDecisionManager

Author: Fabien Potencier ([email protected])
Inheritance: implements Symfony\Component\Security\Authorization\AccessDecisionManagerInterface
Afficher le fichier Open project: pmjones/php-framework-benchmarks Class Usage Examples

Protected Properties

Свойство Type Description
$allowIfAllAbstainDecisions
$allowIfEqualGrantedDeniedDecisions
$strategy
$voters

Méthodes publiques

Méthode Description
__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 )

Méthodes protégées

Méthode Description
decideAffirmative ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null ) Grants access if any voter returns an affirmative response.

Method Details

__construct() public méthode

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() public méthode

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

decide() public méthode

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

decideAffirmative() protected méthode

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() public méthode

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() public méthode

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() public méthode

Returns all voters.
public getVoters ( ) : Symfony\Component\Security\Authorization\Voter\VoterInterface[]
Résultat Symfony\Component\Security\Authorization\Voter\VoterInterface[] $voters An array of VoterInterface instances

setVoters() public méthode

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

supportsAttribute() public méthode

public supportsAttribute ( $attribute )

supportsClass() public méthode

public supportsClass ( $class )

Property Details

$allowIfAllAbstainDecisions protected_oe property

protected $allowIfAllAbstainDecisions

$allowIfEqualGrantedDeniedDecisions protected_oe property

protected $allowIfEqualGrantedDeniedDecisions

$strategy protected_oe property

protected $strategy

$voters protected_oe property

protected $voters