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:
parent
649fafe5c0
commit
121f6a110c
@ -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,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user