From 099a6d3609cc8ab026676657dfbd941332bb832b Mon Sep 17 00:00:00 2001 From: Polonkai Gergely Date: Thu, 9 Aug 2012 17:54:55 +0200 Subject: [PATCH] Bug fix: _securityController was not defined in ArticleController Signed-off-by: Gergely Polonkai --- src/KekRozsak/FrontBundle/Controller/ArticleController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/KekRozsak/FrontBundle/Controller/ArticleController.php b/src/KekRozsak/FrontBundle/Controller/ArticleController.php index 03792d0..4735d94 100644 --- a/src/KekRozsak/FrontBundle/Controller/ArticleController.php +++ b/src/KekRozsak/FrontBundle/Controller/ArticleController.php @@ -6,6 +6,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; +use Symfony\Component\Security\Core\Exception\AccessDeniedException; use KekRozsak\FrontBundle\Entity\Article; @@ -20,7 +21,8 @@ class ArticleController extends Controller */ public function viewAction(Article $article) { - if ((!is_object($this->_securityContext->getToken()) || !is_object($this->_securityContext->getToken()->getUser())) && !$article->isPublic()) + $scontext = $this->get('security.context'); + if ((!is_object($scontext->getToken()) || !is_object($scontext->getToken()->getUser())) && !$article->isPublic()) throw new AccessDeniedException('A cikk megtekintéséhez be kell jelentkezned!'); return array(