diff --git a/src/KekRozsak/FrontBundle/Twig/NewsExtension.php b/src/KekRozsak/FrontBundle/Twig/NewsExtension.php index 491b428..1cfe3ab 100644 --- a/src/KekRozsak/FrontBundle/Twig/NewsExtension.php +++ b/src/KekRozsak/FrontBundle/Twig/NewsExtension.php @@ -21,7 +21,7 @@ class NewsExtension extends \Twig_Extension { $newsRepo = $this->_doctrine->getRepository('KekRozsakFrontBundle:News'); $searchCriteria = array(); - if (!$this->_securityContext->getToken() instanceof Symfony\Component\Security\Core\Authentication\Token\AnonymousToken) + if (!is_object($this->_securityContext->getToken()->getUser())) $searchCriteria['public'] = true; $news = $newsRepo->findBy($searchCriteria, array('createdAt' => 'DESC'), 4);