Symfony\Component\Security\Authorization\AccessDecisionManager::decide PHP 메소드

decide() 공개 메소드

public decide ( Symfony\Component\Security\Authentication\Token\TokenInterface $token, array $attributes, $object = null )
$token Symfony\Component\Security\Authentication\Token\TokenInterface
$attributes array
    public function decide(TokenInterface $token, array $attributes, $object = null)
    {
        return $this->{$this->strategy}($token, $attributes, $object);
    }

Usage Example

 /**
  * @dataProvider getStrategyTests
  */
 public function testStrategies($strategy, $voters, $allowIfAllAbstainDecisions, $allowIfEqualGrantedDeniedDecisions, $expected)
 {
     $token = $this->getMock('Symfony\\Component\\Security\\Authentication\\Token\\TokenInterface');
     $manager = new AccessDecisionManager($voters, $strategy, $allowIfAllAbstainDecisions, $allowIfEqualGrantedDeniedDecisions);
     $this->assertSame($expected, $manager->decide($token, array('ROLE_FOO')));
 }