forked from wallabag/wallabag
Add IsGranted to ConfigController
This commit is contained in:
@ -139,4 +139,18 @@ class MainVoterTest extends TestCase
|
||||
|
||||
$this->assertSame(VoterInterface::ACCESS_GRANTED, $this->mainVoter->vote($this->token, null, [MainVoter::CREATE_SITE_CREDENTIALS]));
|
||||
}
|
||||
|
||||
public function testVoteReturnsDeniedForNonUserEditConfig(): void
|
||||
{
|
||||
$this->security->method('isGranted')->with('ROLE_USER')->willReturn(false);
|
||||
|
||||
$this->assertSame(VoterInterface::ACCESS_DENIED, $this->mainVoter->vote($this->token, null, [MainVoter::EDIT_CONFIG]));
|
||||
}
|
||||
|
||||
public function testVoteReturnsGrantedForUserEditConfig(): void
|
||||
{
|
||||
$this->security->method('isGranted')->with('ROLE_USER')->willReturn(true);
|
||||
|
||||
$this->assertSame(VoterInterface::ACCESS_GRANTED, $this->mainVoter->vote($this->token, null, [MainVoter::EDIT_CONFIG]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user