示例#1
0
 /**
  * {@inheritDoc}
  */
 public function savePost(PostInterface $post)
 {
     if (!$this->postAcl->canCreate()) {
         throw new AccessDeniedException();
     }
     $newPost = $this->isNewPost($post);
     if (!$newPost && !$this->postAcl->canEdit($post)) {
         throw new AccessDeniedException();
     }
     $this->realManager->savePost($post);
     if ($newPost) {
         $this->postAcl->setDefaultAcl($post);
     }
 }
示例#2
0
 /**
  * @return boolean
  */
 public function canCreate()
 {
     return $this->postAcl->canCreate();
 }