From 4fc998245c56ad95c1e753ab52b0c702d4a8a59d Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 16 Sep 2016 20:08:07 +0200 Subject: [PATCH] Only display message in queue for admin Instead of for EVERYONE --- src/Wallabag/ImportBundle/Controller/ImportController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php index d670746cb..ea4f7d7bb 100644 --- a/src/Wallabag/ImportBundle/Controller/ImportController.php +++ b/src/Wallabag/ImportBundle/Controller/ImportController.php @@ -19,12 +19,20 @@ class ImportController extends Controller /** * Display how many messages are queue (both in Redis and RabbitMQ). + * Only for admins. */ public function checkQueueAction() { $nbRedisMessages = null; $nbRabbitMessages = null; + if (!$this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) { + return $this->render('WallabagImportBundle:Import:check_queue.html.twig', [ + 'nbRedisMessages' => $nbRedisMessages, + 'nbRabbitMessages' => $nbRabbitMessages, + ]); + } + if ($this->get('craue_config')->get('import_with_rabbitmq')) { $nbRabbitMessages = $this->getTotalMessageInRabbitQueue('pocket') + $this->getTotalMessageInRabbitQueue('readability')