1
0
mirror of https://github.com/flarum/core.git synced 2025-10-18 10:16:09 +02:00

Remove ability for users to delete themselves

This commit is contained in:
Toby Zerner
2015-08-04 21:35:41 +09:30
parent 5fa7a8c555
commit 187517a9c7
5 changed files with 1 additions and 88 deletions

View File

@@ -28,7 +28,7 @@ class UsersServiceProvider extends ServiceProvider
$events->listen(ModelAllow::class, function (ModelAllow $event) {
if ($event->model instanceof User) {
if (in_array($event->action, ['edit', 'delete']) &&
if ($event->action === 'edit') &&
$event->model->id == $event->actor->id) {
return true;
}