mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
Give author permission to delete discussion if there are no replies
Forgot to commit this part in 64e5d50533
:3
This commit is contained in:
parent
a09c86e42d
commit
b4dcc02520
|
@ -247,5 +247,12 @@ class CoreServiceProvider extends ServiceProvider
|
|||
// @todo add limitations to time etc. according to a config setting
|
||||
}
|
||||
});
|
||||
|
||||
Discussion::allow('delete', function ($discussion, $user) {
|
||||
if ($discussion->start_user_id == $user->id && $discussion->participants_count == 1) {
|
||||
return true;
|
||||
// @todo add limitations to time etc. according to a config setting
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user