/** * {@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); } }
/** * @param PostInterface $post * * @return boolean */ public function canEdit(PostInterface $post) { return $this->postAcl->canEdit($post); }