vote() public method

public vote ( Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token, $object, array $attributes )
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface
$attributes array
Exemplo n.º 1
0
 public function testNegativeVoteWithMultipleAttributes()
 {
     $securityCondition = new SecurityCondition('sulu.security.roles', null);
     $this->accessControlManager->getUserPermissions($securityCondition, $this->user)->willReturn(['view' => true, 'add' => true, 'security' => false]);
     $access = $this->voter->vote($this->token->reveal(), $securityCondition, ['view', 'security']);
     $this->assertSame(VoterInterface::ACCESS_DENIED, $access);
 }
Exemplo n.º 2
0
 public function testNegativeVoteWithMultipleAttributes()
 {
     $this->aclProvider->findAcl(Argument::any())->willThrow(AclNotFoundException::class);
     $access = $this->voter->vote($this->token->reveal(), new SecurityCondition('sulu.security.roles', null), ['view', 'security']);
     $this->assertSame(VoterInterface::ACCESS_DENIED, $access);
 }