/** * {@inheritDoc} */ public function addVote(VoteInterface $vote, VotableCommentInterface $comment) { if (!$this->voteAcl->canCreate()) { throw new AccessDeniedException(); } if (!$this->commentAcl->canView($comment)) { throw new AccessDeniedException(); } $this->realManager->addVote($vote, $comment); $this->voteAcl->setDefaultAcl($vote); }
/** * {@inheritDoc} */ public function saveVote(VoteInterface $vote) { if (!$this->voteAcl->canCreate()) { throw new AccessDeniedException(); } if (!$this->commentAcl->canView($vote->getComment())) { throw new AccessDeniedException(); } $this->realManager->saveVote($vote); $this->voteAcl->setDefaultAcl($vote); }