Bug fix: _securityController was not defined in ArticleController
Signed-off-by: Gergely Polonkai <polesz@w00d5t0ck.info>
This commit is contained in:
parent
f782c28678
commit
099a6d3609
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user