Fixing privacy in PostController::showAction().

This commit is contained in:
Alexey Skobkin 2019-04-03 18:07:47 +03:00
parent 184030ebd5
commit 0c004085fd
1 changed files with 4 additions and 0 deletions

View File

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