From 88005fbf54c76ff36e6c2cdff26c40721d8d7d24 Mon Sep 17 00:00:00 2001 From: Andres Orozco Date: Thu, 23 May 2019 16:03:22 -0400 Subject: [PATCH] MM-15662: Rename "CreateBotAccounts" config.json setting to "EnableBotAccountCreation" (#10875) * MM-15662 change conflig flag to EnableBotAccountCreation * undo changes to i18n * MM-15662: Change config flag for bot creation adds newline to i18n * MM-15662 Update diagnostics.go to use new config flag --- api4/bot.go | 2 +- api4/bot_test.go | 50 ++++++++++++++++++++++----------------------- api4/user_test.go | 28 ++++++++++++------------- app/diagnostics.go | 2 +- config/client.go | 4 ++-- config/default.json | 2 +- model/config.go | 6 +++--- 7 files changed, 47 insertions(+), 47 deletions(-) diff --git a/api4/bot.go b/api4/bot.go index 2c9373f135..e0d532b2be 100644 --- a/api4/bot.go +++ b/api4/bot.go @@ -43,7 +43,7 @@ func createBot(c *Context, w http.ResponseWriter, r *http.Request) { } } - if !*c.App.Config().ServiceSettings.CreateBotAccounts { + if !*c.App.Config().ServiceSettings.EnableBotAccountCreation { c.Err = model.NewAppError("createBot", "api.bot.create_disabled", nil, "", http.StatusForbidden) return } diff --git a/api4/bot_test.go b/api4/bot_test.go index 976c727e85..9e14f60d68 100644 --- a/api4/bot_test.go +++ b/api4/bot_test.go @@ -18,7 +18,7 @@ func TestCreateBot(t *testing.T) { defer th.TearDown() th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) _, resp := th.Client.CreateBot(&model.Bot{ @@ -36,7 +36,7 @@ func TestCreateBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) - th.App.Config().ServiceSettings.CreateBotAccounts = model.NewBool(false) + th.App.Config().ServiceSettings.EnableBotAccountCreation = model.NewBool(false) _, resp := th.Client.CreateBot(&model.Bot{ Username: GenerateTestUsername(), @@ -55,7 +55,7 @@ func TestCreateBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ @@ -80,7 +80,7 @@ func TestCreateBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) _, resp := th.Client.CreateBot(&model.Bot{ @@ -97,7 +97,7 @@ func TestCreateBot(t *testing.T) { defer th.TearDown() th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableUserAccessTokens = true }) @@ -145,7 +145,7 @@ func TestPatchBot(t *testing.T) { defer th.RestoreDefaultRolePermissions(th.SaveDefaultRolePermissions()) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.SystemAdminClient.CreateBot(&model.Bot{ @@ -168,7 +168,7 @@ func TestPatchBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_READ_OTHERS_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.SystemAdminClient.CreateBot(&model.Bot{ @@ -191,7 +191,7 @@ func TestPatchBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_MANAGE_OTHERS_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.SystemAdminClient.CreateBot(&model.Bot{ @@ -224,7 +224,7 @@ func TestPatchBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.Client.CreateBot(&model.Bot{ @@ -254,7 +254,7 @@ func TestPatchBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_READ_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.Client.CreateBot(&model.Bot{ @@ -284,7 +284,7 @@ func TestPatchBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_MANAGE_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.Client.CreateBot(&model.Bot{ @@ -318,7 +318,7 @@ func TestPatchBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_MANAGE_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ @@ -352,7 +352,7 @@ func TestPatchBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_MANAGE_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.Client.CreateBot(&model.Bot{ @@ -382,7 +382,7 @@ func TestGetBot(t *testing.T) { defer th.TearDown() th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot1, resp := th.SystemAdminClient.CreateBot(&model.Bot{ @@ -413,7 +413,7 @@ func TestGetBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) myBot, resp := th.Client.CreateBot(&model.Bot{ @@ -526,7 +526,7 @@ func TestGetBots(t *testing.T) { defer th.TearDown() th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot1, resp := th.SystemAdminClient.CreateBot(&model.Bot{ @@ -762,7 +762,7 @@ func TestDisableBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ @@ -787,7 +787,7 @@ func TestDisableBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_READ_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ @@ -812,7 +812,7 @@ func TestDisableBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_MANAGE_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot, resp := th.Client.CreateBot(&model.Bot{ @@ -856,7 +856,7 @@ func TestEnableBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ @@ -884,7 +884,7 @@ func TestEnableBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_READ_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ @@ -912,7 +912,7 @@ func TestEnableBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_MANAGE_BOTS.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot, resp := th.Client.CreateBot(&model.Bot{ @@ -958,7 +958,7 @@ func TestAssignBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.SYSTEM_USER_ROLE_ID) th.AddPermissionToRole(model.PERMISSION_READ_BOTS.Id, model.SYSTEM_USER_ROLE_ID) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ @@ -1000,7 +1000,7 @@ func TestAssignBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.SYSTEM_USER_ROLE_ID) th.AddPermissionToRole(model.PERMISSION_READ_BOTS.Id, model.SYSTEM_USER_ROLE_ID) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ @@ -1031,7 +1031,7 @@ func TestAssignBot(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_BOT.Id, model.SYSTEM_USER_ROLE_ID) th.AddPermissionToRole(model.PERMISSION_READ_BOTS.Id, model.SYSTEM_USER_ROLE_ID) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ diff --git a/api4/user_test.go b/api4/user_test.go index dc0b26a863..104f70f8b2 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -528,7 +528,7 @@ func TestGetBotUser(t *testing.T) { th.App.UpdateUserRoles(th.BasicUser.Id, model.SYSTEM_USER_ROLE_ID+" "+model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) bot := &model.Bot{ @@ -2645,7 +2645,7 @@ func TestLogin(t *testing.T) { th.Client.Logout() th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) t.Run("missing password", func(t *testing.T) { @@ -2739,7 +2739,7 @@ func TestCBALogin(t *testing.T) { th.App.SetLicense(model.NewTestLicense("saml")) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) th.App.UpdateConfig(func(cfg *model.Config) { @@ -2797,7 +2797,7 @@ func TestCBALogin(t *testing.T) { th.App.SetLicense(model.NewTestLicense("saml")) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) th.Client.HttpHeader["X-SSL-Client-Cert"] = "valid_cert_fake" @@ -3105,7 +3105,7 @@ func TestCreateUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.Client.CreateBot(&model.Bot{ @@ -3145,7 +3145,7 @@ func TestCreateUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_CREATE_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.SystemAdminClient.CreateBot(&model.Bot{ @@ -3246,7 +3246,7 @@ func TestGetUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_READ_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.Client.CreateBot(&model.Bot{ @@ -3292,7 +3292,7 @@ func TestGetUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_READ_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.SystemAdminClient.CreateBot(&model.Bot{ @@ -3539,7 +3539,7 @@ func TestRevokeUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_REVOKE_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.Client.CreateBot(&model.Bot{ @@ -3582,7 +3582,7 @@ func TestRevokeUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_REVOKE_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.SystemAdminClient.CreateBot(&model.Bot{ @@ -3657,7 +3657,7 @@ func TestDisableUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_REVOKE_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.Client.CreateBot(&model.Bot{ @@ -3700,7 +3700,7 @@ func TestDisableUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_REVOKE_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.SystemAdminClient.CreateBot(&model.Bot{ @@ -3785,7 +3785,7 @@ func TestEnableUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_REVOKE_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.Client.CreateBot(&model.Bot{ @@ -3832,7 +3832,7 @@ func TestEnableUserAccessToken(t *testing.T) { th.AddPermissionToRole(model.PERMISSION_REVOKE_USER_ACCESS_TOKEN.Id, model.TEAM_USER_ROLE_ID) th.App.UpdateUserRoles(th.BasicUser.Id, model.TEAM_USER_ROLE_ID, false) th.App.UpdateConfig(func(cfg *model.Config) { - *cfg.ServiceSettings.CreateBotAccounts = true + *cfg.ServiceSettings.EnableBotAccountCreation = true }) createdBot, resp := th.SystemAdminClient.CreateBot(&model.Bot{ diff --git a/app/diagnostics.go b/app/diagnostics.go index e13186e3c5..23ebb69778 100644 --- a/app/diagnostics.go +++ b/app/diagnostics.go @@ -292,7 +292,7 @@ func (a *App) trackConfig() { "experimental_channel_organization": *cfg.ServiceSettings.ExperimentalChannelOrganization, "experimental_ldap_group_sync": *cfg.ServiceSettings.ExperimentalLdapGroupSync, "disable_bots_when_owner_is_deactivated": *cfg.ServiceSettings.DisableBotsWhenOwnerIsDeactivated, - "enable_bot_account_creation": *cfg.ServiceSettings.CreateBotAccounts, + "enable_bot_account_creation": *cfg.ServiceSettings.EnableBotAccountCreation, }) a.SendDiagnostic(TRACK_CONFIG_TEAM, map[string]interface{}{ diff --git a/config/client.go b/config/client.go index 1e59ccd0b8..5c13142fad 100644 --- a/config/client.go +++ b/config/client.go @@ -23,7 +23,7 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L props["ExperimentalPrimaryTeam"] = *c.TeamSettings.ExperimentalPrimaryTeam props["ExperimentalViewArchivedChannels"] = strconv.FormatBool(*c.TeamSettings.ExperimentalViewArchivedChannels) - props["CreateBotAccounts"] = strconv.FormatBool(*c.ServiceSettings.CreateBotAccounts) + props["EnableBotAccountCreation"] = strconv.FormatBool(*c.ServiceSettings.EnableBotAccountCreation) props["EnableOAuthServiceProvider"] = strconv.FormatBool(*c.ServiceSettings.EnableOAuthServiceProvider) props["GoogleDeveloperKey"] = *c.ServiceSettings.GoogleDeveloperKey props["EnableIncomingWebhooks"] = strconv.FormatBool(*c.ServiceSettings.EnableIncomingWebhooks) @@ -199,7 +199,7 @@ func GenerateLimitedClientConfig(c *model.Config, diagnosticId string, license * props["BuildHashEnterprise"] = model.BuildHashEnterprise props["BuildEnterpriseReady"] = model.BuildEnterpriseReady - props["CreateBotAccounts"] = strconv.FormatBool(*c.ServiceSettings.CreateBotAccounts) + props["EnableBotAccountCreation"] = strconv.FormatBool(*c.ServiceSettings.EnableBotAccountCreation) props["SiteName"] = *c.TeamSettings.SiteName props["WebsocketURL"] = strings.TrimRight(*c.ServiceSettings.WebsocketURL, "/") diff --git a/config/default.json b/config/default.json index f1edfa2ca4..762b8e64ff 100644 --- a/config/default.json +++ b/config/default.json @@ -78,7 +78,7 @@ "EnableEmailInvitations": false, "ExperimentalLdapGroupSync": false, "ExperimentalStrictCSRFEnforcement": false, - "CreateBotAccounts": false, + "EnableBotAccountCreation": false, "DisableBotsWhenOwnerIsDeactivated": true }, "TeamSettings": { diff --git a/model/config.go b/model/config.go index 6112d775b3..b570642263 100644 --- a/model/config.go +++ b/model/config.go @@ -293,7 +293,7 @@ type ServiceSettings struct { EnableEmailInvitations *bool ExperimentalLdapGroupSync *bool DisableBotsWhenOwnerIsDeactivated *bool `restricted:"true"` - CreateBotAccounts *bool + EnableBotAccountCreation *bool } func (s *ServiceSettings) SetDefaults() { @@ -637,8 +637,8 @@ func (s *ServiceSettings) SetDefaults() { s.DisableBotsWhenOwnerIsDeactivated = NewBool(true) } - if s.CreateBotAccounts == nil { - s.CreateBotAccounts = NewBool(false) + if s.EnableBotAccountCreation == nil { + s.EnableBotAccountCreation = NewBool(false) } }