/** * {@inheritDoc} */ public function findPostsByTopic(TopicInterface $topic, $page = 1) { $posts = $this->realManager->findPostsByTopic($topic, $page); foreach ($posts as $post) { if (!$this->postAcl->canView($post)) { throw new AccessDeniedException(); } } return $posts; }
/** * @param PostInterface $post * * @return boolean */ public function canView(PostInterface $post) { return $this->postAcl->canView($post); }