Esempio n. 1
0
 /**
  * {@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);
 }
 /**
  * {@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);
 }