protected function isAdmin()
{
if ($this->has('security.authorization_checker') && $this->get('security.token_storage')->getToken() && $this->get('security.authorization_checker')->isGranted('ROLE_ADMIN') || $this->has('security.context') && $this->get('security.context')->getToken() && $this->get('security.context')->isGranted('ROLE_ADMIN')) {
return true;
}
return false;
}