Fixing privacy in PostController::showAction().
This commit is contained in:
parent
184030ebd5
commit
0c004085fd
|
@ -17,6 +17,10 @@ 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()) {
|
||||||
|
throw $this->createNotFoundException('Author\'s blog is private.');
|
||||||
|
}
|
||||||
|
|
||||||
return $this->render('SkobkinPointToolsBundle:Post:show.html.twig', [
|
return $this->render('SkobkinPointToolsBundle:Post:show.html.twig', [
|
||||||
'post' => $postRepository->getPostWithComments($post->getId()),
|
'post' => $postRepository->getPostWithComments($post->getId()),
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue