Article view is now security aware

ArticleController::viewAction is now aware of Article::public

Signed-off-by: Gergely Polonkai <polesz@w00d5t0ck.info>
This commit is contained in:
Polonkai Gergely 2012-08-09 09:31:44 +02:00
parent 649fafe5c0
commit 121f6a110c

View File

@ -20,6 +20,9 @@ class ArticleController extends Controller
*/ */
public function viewAction(Article $article) public function viewAction(Article $article)
{ {
if ((!is_object($this->_securityContext->getToken()) || !is_object($this->_securityContext->getToken()->getUser())) && !$article->isPublic())
throw new AccessDeniedException('A cikk megtekintéséhez be kell jelentkezned!');
return array( return array(
'article' => $article, 'article' => $article,
); );