1
0
mirror of https://github.com/flarum/core.git synced 2025-08-24 17:13:44 +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;
}

View File

@@ -39,8 +39,6 @@ class ClientAction extends BaseClientAction
'core.confirmation_email_sent',
'core.controls',
'core.delete',
'core.delete_account',
'core.delete_account_help',
'core.delete_forever',
'core.deleted',
'core.disclose_online',
@@ -94,7 +92,6 @@ class ClientAction extends BaseClientAction
'core.post_reply',
'core.posted_a_reply',
'core.posts',
'core.posts_will_remain',
'core.powered_by_flarum',
'core.privacy',
'core.profile',
@@ -123,7 +120,6 @@ class ClientAction extends BaseClientAction
'core.upload',
'core.username',
'core.username_or_email',
'core.username_will_be_released',
'core.users',
'core.view',
'core.viewing_posts',