protected function getAdminPool() { if ($this->get('security.token_storage')->getToken() && $this->get('security.authorization_checker')->isGranted('ROLE_SONATA_ADMIN')) { return $this->get('sonata.admin.pool'); } return false; }