mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Disable controller access if feature disabled
If `restricted_access` is disabled, accessing `/site-credentials/` must be disabled.
This commit is contained in:
parent
709e21a3f4
commit
ef2b4041fb
2 changed files with 32 additions and 0 deletions
|
@ -8,6 +8,20 @@ use Wallabag\CoreBundle\Entity\SiteCredential;
|
|||
|
||||
class SiteCredentialControllerTest extends WallabagCoreTestCase
|
||||
{
|
||||
public function testAccessDeniedBecauseFeatureDisabled()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
$client = $this->getClient();
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('restricted_access', 0);
|
||||
|
||||
$client->request('GET', '/site-credentials/');
|
||||
|
||||
$this->assertSame(404, $client->getResponse()->getStatusCode());
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('restricted_access', 1);
|
||||
}
|
||||
|
||||
public function testListSiteCredential()
|
||||
{
|
||||
$this->logInAs('admin');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue