diff --git a/src/Post/PostPolicy.php b/src/Post/PostPolicy.php index 5dee602a6..c0b1a28c3 100644 --- a/src/Post/PostPolicy.php +++ b/src/Post/PostPolicy.php @@ -115,9 +115,9 @@ class PostPolicy extends AbstractPolicy */ public function edit(User $actor, Post $post) { - // A post is allowed to be edited if the user has permission to moderate - // the discussion which it's in, or if they are the author and the post - // hasn't been deleted by someone else. + // A post is allowed to be edited if the user is the author, the post + // hasn't been deleted by someone else, and the user is allowed to + // create new replies in the discussion. if ($post->user_id == $actor->id && (! $post->hidden_at || $post->hidden_user_id == $actor->id) && $actor->can('reply', $post->discussion)) { $allowEditing = $this->settings->get('allow_post_editing'); @@ -128,4 +128,14 @@ class PostPolicy extends AbstractPolicy } } } + + /** + * @param User $actor + * @param Post $post + * @return bool|null + */ + public function hide(User $actor, Post $post) + { + return $this->edit($actor, $post); + } }