mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 17:32:46 +08:00
Give author permission to delete discussion if there are no replies
Forgot to commit this part in 3223f65ce3
:3
This commit is contained in:
parent
951db23ffd
commit
ff0c078e5a
|
@ -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