AccessDecisionManager
class AccessDecisionManager implements AccessDecisionManagerInterface
AccessDecisionManager is the base class for all access decision managers that use decision voters.
Constants
| STRATEGY_AFFIRMATIVE | |
| STRATEGY_CONSENSUS | |
| STRATEGY_UNANIMOUS |
Methods
| __construct(iterable|VoterInterface[] $voters = array(), string $strategy = self::STRATEGY_AFFIRMATIVE, bool $allowIfAllAbstainDecisions = false, bool $allowIfEqualGrantedDeniedDecisions = true) | ||
| setVoters(array $voters) deprecated Configures the voters. | ||
| bool | decide(TokenInterface $token, array $attributes, object $object = null) Decides whether the access is possible or not. |
Details
__construct(iterable|VoterInterface[] $voters = array(), string $strategy = self::STRATEGY_AFFIRMATIVE, bool $allowIfAllAbstainDecisions = false, bool $allowIfEqualGrantedDeniedDecisions = true)
Parameters
| iterable|VoterInterface[] | $voters | An iterator of VoterInterface instances |
| string | $strategy | The vote strategy |
| bool | $allowIfAllAbstainDecisions | Whether to grant access if all voters abstained or not |
| bool | $allowIfEqualGrantedDeniedDecisions | Whether to grant access if result are equals |
Exceptions
| InvalidArgumentException |
setVoters(array $voters) deprecated
deprecated
Configures the voters.
Parameters
| array | $voters | An array of VoterInterface instances |
bool decide(TokenInterface $token, array $attributes, object $object = null)
Decides whether the access is possible or not.
Parameters
| TokenInterface | $token | A TokenInterface instance |
| array | $attributes | An array of attributes associated with the method being invoked |
| object | $object | The object to secure |
Return Value
| bool | true if the access is granted, false otherwise |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.3/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.html