Fixing PostController::showAction() exception on private author's post.

This commit is contained in:
Alexey Skobkin 2019-04-03 18:52:36 +03:00
parent d9c0673445
commit 5e8935ce66

View file

@ -18,7 +18,7 @@ class PostController extends AbstractController
public function showAction(Post $post, PostRepository $postRepository): Response public function showAction(Post $post, PostRepository $postRepository): Response
{ {
if ((!$post->getAuthor()->isPublic()) || $post->getAuthor()->isWhitelistOnly()) { if ((!$post->getAuthor()->isPublic()) || $post->getAuthor()->isWhitelistOnly()) {
throw $this->createNotFoundException('Author\'s blog is private.'); throw $this->createAccessDeniedException('Author\'s blog is private.');
} }
return $this->render('SkobkinPointToolsBundle:Post:show.html.twig', [ return $this->render('SkobkinPointToolsBundle:Post:show.html.twig', [