mirror of
https://github.com/flarum/framework.git
synced 2025-01-20 02:42:44 +08:00
Users should not be able to restore discussions if deleted by admins (#2037)
This commit is contained in:
parent
a2d1d2b819
commit
e10da825d4
|
@ -139,7 +139,11 @@ class DiscussionPolicy extends AbstractPolicy
|
|||
*/
|
||||
public function hide(User $actor, Discussion $discussion)
|
||||
{
|
||||
if ($discussion->user_id == $actor->id && $discussion->participant_count <= 1 && $actor->can('reply', $discussion)) {
|
||||
if ($discussion->user_id == $actor->id
|
||||
&& $discussion->participant_count <= 1
|
||||
&& (! $discussion->hidden_at || $discussion->hidden_user_id == $actor->id)
|
||||
&& $actor->can('reply', $discussion)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user