mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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
This commit is contained in:
committed by
Christopher Speller
parent
693d11304b
commit
88005fbf54
@@ -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
|
||||
}
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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{}{
|
||||
|
||||
@@ -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, "/")
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
"EnableEmailInvitations": false,
|
||||
"ExperimentalLdapGroupSync": false,
|
||||
"ExperimentalStrictCSRFEnforcement": false,
|
||||
"CreateBotAccounts": false,
|
||||
"EnableBotAccountCreation": false,
|
||||
"DisableBotsWhenOwnerIsDeactivated": true
|
||||
},
|
||||
"TeamSettings": {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user