Only display message in queue for admin

Instead of for EVERYONE
This commit is contained in:
Jeremy Benoist 2016-09-16 20:08:07 +02:00
parent ac87e0db2a
commit 4fc998245c
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C

View file

@ -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')