From 98e3b0ce77cc8c7367fc9cf592f4d6698d16e7f0 Mon Sep 17 00:00:00 2001 From: guillaume Date: Tue, 30 Jul 2019 11:57:21 +0200 Subject: Add admin setting to prevent users to self deleting their account --- client/components/settings/settingBody.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'client/components/settings/settingBody.js') diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 4ec0c759..f9b5c08d 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -233,12 +233,17 @@ BlazeComponent.extendComponent({ $('input[name=allowEmailChange]:checked').val() === 'true'; const allowUserNameChange = $('input[name=allowUserNameChange]:checked').val() === 'true'; + const allowUserDelete = + $('input[name=allowUserDelete]:checked').val() === 'true'; AccountSettings.update('accounts-allowEmailChange', { $set: { booleanValue: allowEmailChange }, }); AccountSettings.update('accounts-allowUserNameChange', { $set: { booleanValue: allowUserNameChange }, }); + AccountSettings.update('accounts-allowUserDelete', { + $set: { booleanValue: allowUserDelete }, + }); }, allowEmailChange() { @@ -247,6 +252,9 @@ BlazeComponent.extendComponent({ allowUserNameChange() { return AccountSettings.findOne('accounts-allowUserNameChange').booleanValue; }, + allowUserDelete() { + return AccountSettings.findOne('accounts-allowUserDelete').booleanValue; + }, events() { return [ -- cgit v1.2.3-1-g7c22