From a40a8038d3eb7f5e31cb364a4fb695e1ef02b9a6 Mon Sep 17 00:00:00 2001 From: Christophe VERGNE Date: Mon, 11 Dec 2017 16:04:06 +0100 Subject: Fix All RSS not accessible if not logged in + Tests --- app/config/security.yml | 2 +- .../CoreBundle/Controller/RssControllerTest.php | 25 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/config/security.yml b/app/config/security.yml index e14a0bd1..796dc361 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -60,7 +60,7 @@ security: - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } - - { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } + - { path: /(unread|starred|archive|all).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: /tags/(.*).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/share, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/settings, roles: ROLE_SUPER_ADMIN } diff --git a/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php b/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php index c6ca4937..2af6e14f 100644 --- a/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php @@ -61,6 +61,9 @@ class RssControllerTest extends WallabagCoreTestCase [ '/wallace/YZIOAUZIAO/archives.xml', ], + [ + '/wallace/YZIOAUZIAO/all.xml', + ], ]; } @@ -141,6 +144,28 @@ class RssControllerTest extends WallabagCoreTestCase $this->validateDom($client->getResponse()->getContent(), 'archive', 'archive'); } + public function testAll() + { + $client = $this->getClient(); + $em = $client->getContainer()->get('doctrine.orm.entity_manager'); + $user = $em + ->getRepository('WallabagUserBundle:User') + ->findOneByUsername('admin'); + + $config = $user->getConfig(); + $config->setRssToken('SUPERTOKEN'); + $config->setRssLimit(null); + $em->persist($config); + $em->flush(); + + $client = $this->getClient(); + $client->request('GET', '/admin/SUPERTOKEN/all.xml'); + + $this->assertSame(200, $client->getResponse()->getStatusCode()); + + $this->validateDom($client->getResponse()->getContent(), 'all', 'all'); + } + public function testPagination() { $client = $this->getClient(); -- cgit v1.2.3