/** * Delete a blog post * * @param array $post * @param array $authorsAllowed * @param array $oldPost * @return bool */ protected function processDeletePost(array $post, array $authorsAllowed = [], array $oldPost = []) : bool { // Extra caution: check permissions again. if (!$this->isSuperUser()) { if (!$this->can('delete')) { // Does this author belong to you? if (!\in_array((int) $oldPost['author'], $authorsAllowed)) { return false; } } } return $this->blog->deletePost($post, $oldPost); }