MM-12815: Clearly deprecated disused config settings. (#9751)

* MM-12815: Clearly deprecated disused config settings.

* Fix tests.
Этот коммит содержится в:
George Goldberg
2018-10-31 08:38:38 +00:00
коммит произвёл GitHub
родитель f23eeb56c7
Коммит 8d3cfc6ad7
9 изменённых файлов: 124 добавлений и 139 удалений

Просмотреть файл

@@ -218,15 +218,10 @@ func TestListCommands(t *testing.T) {
Client := th.Client Client := th.Client
enableCommands := *th.App.Config().ServiceSettings.EnableCommands enableCommands := *th.App.Config().ServiceSettings.EnableCommands
enableOnlyAdminIntegrations := *th.App.Config().ServiceSettings.EnableOnlyAdminIntegrations
defer func() { defer func() {
th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableCommands = &enableCommands }) th.App.UpdateConfig(func(cfg *model.Config) { cfg.ServiceSettings.EnableCommands = &enableCommands })
th.App.UpdateConfig(func(cfg *model.Config) {
cfg.ServiceSettings.EnableOnlyAdminIntegrations = &enableOnlyAdminIntegrations
})
}() }()
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableCommands = true }) th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableCommands = true })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.EnableOnlyAdminIntegrations = true })
newCmd := &model.Command{ newCmd := &model.Command{
CreatorId: th.BasicUser.Id, CreatorId: th.BasicUser.Id,

Просмотреть файл

@@ -571,7 +571,7 @@ func (a *App) DoAdvancedPermissionsMigration() {
} }
config := a.Config() config := a.Config()
if *config.ServiceSettings.AllowEditPost == model.ALLOW_EDIT_POST_ALWAYS { if *config.ServiceSettings.DEPRECATED_DO_NOT_USE_AllowEditPost == model.ALLOW_EDIT_POST_ALWAYS {
*config.ServiceSettings.PostEditTimeLimit = -1 *config.ServiceSettings.PostEditTimeLimit = -1
if err := a.SaveConfig(config, true); err != nil { if err := a.SaveConfig(config, true); err != nil {
mlog.Error("Failed to update config in Advanced Permissions Phase 1 Migration.", mlog.String("error", err.Error())) mlog.Error("Failed to update config in Advanced Permissions Phase 1 Migration.", mlog.String("error", err.Error()))
@@ -611,7 +611,7 @@ func (a *App) DoEmojisPermissionsMigration() {
var err *model.AppError = nil var err *model.AppError = nil
mlog.Info("Migrating emojis config to database.") mlog.Info("Migrating emojis config to database.")
switch *a.Config().ServiceSettings.RestrictCustomEmojiCreation { switch *a.Config().ServiceSettings.DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation {
case model.RESTRICT_EMOJI_CREATION_ALL: case model.RESTRICT_EMOJI_CREATION_ALL:
role, err = a.GetRoleByName(model.SYSTEM_USER_ROLE_ID) role, err = a.GetRoleByName(model.SYSTEM_USER_ROLE_ID)
if err != nil { if err != nil {

Просмотреть файл

@@ -242,19 +242,19 @@ func TestDoAdvancedPermissionsMigration(t *testing.T) {
} }
// Add a license and change the policy config. // Add a license and change the policy config.
restrictPublicChannel := *th.App.Config().TeamSettings.RestrictPublicChannelManagement restrictPublicChannel := *th.App.Config().TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement
restrictPrivateChannel := *th.App.Config().TeamSettings.RestrictPrivateChannelManagement restrictPrivateChannel := *th.App.Config().TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement
defer func() { defer func() {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictPublicChannelManagement = restrictPublicChannel }) th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement = restrictPublicChannel })
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictPrivateChannelManagement = restrictPrivateChannel }) th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement = restrictPrivateChannel })
}() }()
th.App.UpdateConfig(func(cfg *model.Config) { th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.TeamSettings.RestrictPublicChannelManagement = model.PERMISSIONS_TEAM_ADMIN *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement = model.PERMISSIONS_TEAM_ADMIN
}) })
th.App.UpdateConfig(func(cfg *model.Config) { th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.TeamSettings.RestrictPrivateChannelManagement = model.PERMISSIONS_TEAM_ADMIN *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement = model.PERMISSIONS_TEAM_ADMIN
}) })
th.App.SetLicense(model.NewTestLicense()) th.App.SetLicense(model.NewTestLicense())
@@ -429,30 +429,34 @@ func TestDoAdvancedPermissionsMigration(t *testing.T) {
// Check that the config setting for "always" and "time_limit" edit posts is updated correctly. // Check that the config setting for "always" and "time_limit" edit posts is updated correctly.
th.ResetRoleMigration() th.ResetRoleMigration()
config := th.App.GetConfig() allowEditPost := *th.App.Config().ServiceSettings.DEPRECATED_DO_NOT_USE_AllowEditPost
*config.ServiceSettings.AllowEditPost = "always" postEditTimeLimit := *th.App.Config().ServiceSettings.PostEditTimeLimit
*config.ServiceSettings.PostEditTimeLimit = 300
th.App.SaveConfig(config, false) defer func() {
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_AllowEditPost = allowEditPost})
th.App.UpdateConfig(func(cfg *model.Config) { *cfg.ServiceSettings.PostEditTimeLimit = postEditTimeLimit})
}()
th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_AllowEditPost = "always"
*cfg.ServiceSettings.PostEditTimeLimit = 300
})
th.App.DoAdvancedPermissionsMigration() th.App.DoAdvancedPermissionsMigration()
config = th.App.GetConfig()
config := th.App.GetConfig()
assert.Equal(t, -1, *config.ServiceSettings.PostEditTimeLimit) assert.Equal(t, -1, *config.ServiceSettings.PostEditTimeLimit)
th.ResetRoleMigration() th.ResetRoleMigration()
config = th.App.GetConfig() th.App.UpdateConfig(func(cfg *model.Config) {
*config.ServiceSettings.AllowEditPost = "time_limit" *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_AllowEditPost = "time_limit"
*config.ServiceSettings.PostEditTimeLimit = 300 *cfg.ServiceSettings.PostEditTimeLimit = 300
th.App.SaveConfig(config, false) })
th.App.DoAdvancedPermissionsMigration() th.App.DoAdvancedPermissionsMigration()
config = th.App.GetConfig() config = th.App.GetConfig()
assert.Equal(t, 300, *config.ServiceSettings.PostEditTimeLimit) assert.Equal(t, 300, *config.ServiceSettings.PostEditTimeLimit)
config = th.App.GetConfig()
*config.ServiceSettings.AllowEditPost = "always"
*config.ServiceSettings.PostEditTimeLimit = 300
th.App.SaveConfig(config, false)
} }
func TestDoEmojisPermissionsMigration(t *testing.T) { func TestDoEmojisPermissionsMigration(t *testing.T) {
@@ -464,16 +468,16 @@ func TestDoEmojisPermissionsMigration(t *testing.T) {
} }
// Add a license and change the policy config. // Add a license and change the policy config.
restrictCustomEmojiCreation := *th.App.Config().ServiceSettings.RestrictCustomEmojiCreation restrictCustomEmojiCreation := *th.App.Config().ServiceSettings.DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation
defer func() { defer func() {
th.App.UpdateConfig(func(cfg *model.Config) { th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.RestrictCustomEmojiCreation = restrictCustomEmojiCreation *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation = restrictCustomEmojiCreation
}) })
}() }()
th.App.UpdateConfig(func(cfg *model.Config) { th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.RestrictCustomEmojiCreation = model.RESTRICT_EMOJI_CREATION_SYSTEM_ADMIN *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation = model.RESTRICT_EMOJI_CREATION_SYSTEM_ADMIN
}) })
th.ResetEmojisMigration() th.ResetEmojisMigration()
@@ -538,7 +542,7 @@ func TestDoEmojisPermissionsMigration(t *testing.T) {
assert.Equal(t, expectedSystemAdmin, role1.Permissions, fmt.Sprintf("'%v' did not have expected permissions", model.SYSTEM_ADMIN_ROLE_ID)) assert.Equal(t, expectedSystemAdmin, role1.Permissions, fmt.Sprintf("'%v' did not have expected permissions", model.SYSTEM_ADMIN_ROLE_ID))
th.App.UpdateConfig(func(cfg *model.Config) { th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.RestrictCustomEmojiCreation = model.RESTRICT_EMOJI_CREATION_ADMIN *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation = model.RESTRICT_EMOJI_CREATION_ADMIN
}) })
th.ResetEmojisMigration() th.ResetEmojisMigration()
@@ -567,7 +571,7 @@ func TestDoEmojisPermissionsMigration(t *testing.T) {
assert.Equal(t, expectedSystemAdmin, systemAdmin1.Permissions, fmt.Sprintf("'%v' did not have expected permissions", model.SYSTEM_ADMIN_ROLE_ID)) assert.Equal(t, expectedSystemAdmin, systemAdmin1.Permissions, fmt.Sprintf("'%v' did not have expected permissions", model.SYSTEM_ADMIN_ROLE_ID))
th.App.UpdateConfig(func(cfg *model.Config) { th.App.UpdateConfig(func(cfg *model.Config) {
*cfg.ServiceSettings.RestrictCustomEmojiCreation = model.RESTRICT_EMOJI_CREATION_ALL *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation = model.RESTRICT_EMOJI_CREATION_ALL
}) })
th.ResetEmojisMigration() th.ResetEmojisMigration()

Просмотреть файл

@@ -202,7 +202,7 @@ func (a *App) trackConfig() {
"enable_incoming_webhooks": cfg.ServiceSettings.EnableIncomingWebhooks, "enable_incoming_webhooks": cfg.ServiceSettings.EnableIncomingWebhooks,
"enable_outgoing_webhooks": cfg.ServiceSettings.EnableOutgoingWebhooks, "enable_outgoing_webhooks": cfg.ServiceSettings.EnableOutgoingWebhooks,
"enable_commands": *cfg.ServiceSettings.EnableCommands, "enable_commands": *cfg.ServiceSettings.EnableCommands,
"enable_only_admin_integrations": *cfg.ServiceSettings.EnableOnlyAdminIntegrations, "enable_only_admin_integrations": *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_EnableOnlyAdminIntegrations,
"enable_post_username_override": cfg.ServiceSettings.EnablePostUsernameOverride, "enable_post_username_override": cfg.ServiceSettings.EnablePostUsernameOverride,
"enable_post_icon_override": cfg.ServiceSettings.EnablePostIconOverride, "enable_post_icon_override": cfg.ServiceSettings.EnablePostIconOverride,
"enable_user_access_tokens": *cfg.ServiceSettings.EnableUserAccessTokens, "enable_user_access_tokens": *cfg.ServiceSettings.EnableUserAccessTokens,
@@ -212,7 +212,7 @@ func (a *App) trackConfig() {
"gfycat_api_key": isDefault(*cfg.ServiceSettings.GfycatApiKey, model.SERVICE_SETTINGS_DEFAULT_GFYCAT_API_KEY), "gfycat_api_key": isDefault(*cfg.ServiceSettings.GfycatApiKey, model.SERVICE_SETTINGS_DEFAULT_GFYCAT_API_KEY),
"gfycat_api_secret": isDefault(*cfg.ServiceSettings.GfycatApiSecret, model.SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET), "gfycat_api_secret": isDefault(*cfg.ServiceSettings.GfycatApiSecret, model.SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET),
"experimental_enable_authentication_transfer": *cfg.ServiceSettings.ExperimentalEnableAuthenticationTransfer, "experimental_enable_authentication_transfer": *cfg.ServiceSettings.ExperimentalEnableAuthenticationTransfer,
"restrict_custom_emoji_creation": *cfg.ServiceSettings.RestrictCustomEmojiCreation, "restrict_custom_emoji_creation": *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation,
"enable_testing": cfg.ServiceSettings.EnableTesting, "enable_testing": cfg.ServiceSettings.EnableTesting,
"enable_developer": *cfg.ServiceSettings.EnableDeveloper, "enable_developer": *cfg.ServiceSettings.EnableDeveloper,
"enable_multifactor_authentication": *cfg.ServiceSettings.EnableMultifactorAuthentication, "enable_multifactor_authentication": *cfg.ServiceSettings.EnableMultifactorAuthentication,
@@ -238,8 +238,8 @@ func (a *App) trackConfig() {
"cors_allow_credentials": *cfg.ServiceSettings.CorsAllowCredentials, "cors_allow_credentials": *cfg.ServiceSettings.CorsAllowCredentials,
"cors_debug": *cfg.ServiceSettings.CorsDebug, "cors_debug": *cfg.ServiceSettings.CorsDebug,
"isdefault_allowed_untrusted_internal_connections": isDefault(*cfg.ServiceSettings.AllowedUntrustedInternalConnections, ""), "isdefault_allowed_untrusted_internal_connections": isDefault(*cfg.ServiceSettings.AllowedUntrustedInternalConnections, ""),
"restrict_post_delete": *cfg.ServiceSettings.RestrictPostDelete, "restrict_post_delete": *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_RestrictPostDelete,
"allow_edit_post": *cfg.ServiceSettings.AllowEditPost, "allow_edit_post": *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_AllowEditPost,
"post_edit_time_limit": *cfg.ServiceSettings.PostEditTimeLimit, "post_edit_time_limit": *cfg.ServiceSettings.PostEditTimeLimit,
"enable_user_typing_messages": *cfg.ServiceSettings.EnableUserTypingMessages, "enable_user_typing_messages": *cfg.ServiceSettings.EnableUserTypingMessages,
"enable_channel_viewed_messages": *cfg.ServiceSettings.EnableChannelViewedMessages, "enable_channel_viewed_messages": *cfg.ServiceSettings.EnableChannelViewedMessages,
@@ -265,14 +265,14 @@ func (a *App) trackConfig() {
a.SendDiagnostic(TRACK_CONFIG_TEAM, map[string]interface{}{ a.SendDiagnostic(TRACK_CONFIG_TEAM, map[string]interface{}{
"enable_user_creation": cfg.TeamSettings.EnableUserCreation, "enable_user_creation": cfg.TeamSettings.EnableUserCreation,
"enable_team_creation": *cfg.TeamSettings.EnableTeamCreation, "enable_team_creation": *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_EnableTeamCreation,
"restrict_team_invite": *cfg.TeamSettings.RestrictTeamInvite, "restrict_team_invite": *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictTeamInvite,
"restrict_public_channel_creation": *cfg.TeamSettings.RestrictPublicChannelCreation, "restrict_public_channel_creation": *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPublicChannelCreation,
"restrict_private_channel_creation": *cfg.TeamSettings.RestrictPrivateChannelCreation, "restrict_private_channel_creation": *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelCreation,
"restrict_public_channel_management": *cfg.TeamSettings.RestrictPublicChannelManagement, "restrict_public_channel_management": *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement,
"restrict_private_channel_management": *cfg.TeamSettings.RestrictPrivateChannelManagement, "restrict_private_channel_management": *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement,
"restrict_public_channel_deletion": *cfg.TeamSettings.RestrictPublicChannelDeletion, "restrict_public_channel_deletion": *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPublicChannelDeletion,
"restrict_private_channel_deletion": *cfg.TeamSettings.RestrictPrivateChannelDeletion, "restrict_private_channel_deletion": *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelDeletion,
"enable_open_server": *cfg.TeamSettings.EnableOpenServer, "enable_open_server": *cfg.TeamSettings.EnableOpenServer,
"enable_user_deactivation": *cfg.TeamSettings.EnableUserDeactivation, "enable_user_deactivation": *cfg.TeamSettings.EnableUserDeactivation,
"enable_custom_brand": *cfg.TeamSettings.EnableCustomBrand, "enable_custom_brand": *cfg.TeamSettings.EnableCustomBrand,
@@ -287,7 +287,7 @@ func (a *App) trackConfig() {
"isdefault_custom_brand_text": isDefault(*cfg.TeamSettings.CustomBrandText, model.TEAM_SETTINGS_DEFAULT_CUSTOM_BRAND_TEXT), "isdefault_custom_brand_text": isDefault(*cfg.TeamSettings.CustomBrandText, model.TEAM_SETTINGS_DEFAULT_CUSTOM_BRAND_TEXT),
"isdefault_custom_description_text": isDefault(*cfg.TeamSettings.CustomDescriptionText, model.TEAM_SETTINGS_DEFAULT_CUSTOM_DESCRIPTION_TEXT), "isdefault_custom_description_text": isDefault(*cfg.TeamSettings.CustomDescriptionText, model.TEAM_SETTINGS_DEFAULT_CUSTOM_DESCRIPTION_TEXT),
"isdefault_user_status_away_timeout": isDefault(*cfg.TeamSettings.UserStatusAwayTimeout, model.TEAM_SETTINGS_DEFAULT_USER_STATUS_AWAY_TIMEOUT), "isdefault_user_status_away_timeout": isDefault(*cfg.TeamSettings.UserStatusAwayTimeout, model.TEAM_SETTINGS_DEFAULT_USER_STATUS_AWAY_TIMEOUT),
"restrict_private_channel_manage_members": *cfg.TeamSettings.RestrictPrivateChannelManageMembers, "restrict_private_channel_manage_members": *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManageMembers,
"enable_X_to_leave_channels_from_LHS": *cfg.TeamSettings.EnableXToLeaveChannelsFromLHS, "enable_X_to_leave_channels_from_LHS": *cfg.TeamSettings.EnableXToLeaveChannelsFromLHS,
"experimental_enable_automatic_replies": *cfg.TeamSettings.ExperimentalEnableAutomaticReplies, "experimental_enable_automatic_replies": *cfg.TeamSettings.ExperimentalEnableAutomaticReplies,
"experimental_town_square_is_hidden_in_lhs": *cfg.TeamSettings.ExperimentalHideTownSquareinLHS, "experimental_town_square_is_hidden_in_lhs": *cfg.TeamSettings.ExperimentalHideTownSquareinLHS,

Просмотреть файл

@@ -93,7 +93,6 @@ func serverForWebClientTestsCmdF(command *cobra.Command, args []string) error {
func setupClientTests(cfg *model.Config) { func setupClientTests(cfg *model.Config) {
*cfg.TeamSettings.EnableOpenServer = true *cfg.TeamSettings.EnableOpenServer = true
*cfg.ServiceSettings.EnableCommands = false *cfg.ServiceSettings.EnableCommands = false
*cfg.ServiceSettings.EnableOnlyAdminIntegrations = false
*cfg.ServiceSettings.EnableCustomEmoji = true *cfg.ServiceSettings.EnableCustomEmoji = true
cfg.ServiceSettings.EnableIncomingWebhooks = false cfg.ServiceSettings.EnableIncomingWebhooks = false
cfg.ServiceSettings.EnableOutgoingWebhooks = false cfg.ServiceSettings.EnableOutgoingWebhooks = false

Просмотреть файл

@@ -222,7 +222,7 @@ type ServiceSettings struct {
EnableIncomingWebhooks bool EnableIncomingWebhooks bool
EnableOutgoingWebhooks bool EnableOutgoingWebhooks bool
EnableCommands *bool EnableCommands *bool
EnableOnlyAdminIntegrations *bool DEPRECATED_DO_NOT_USE_EnableOnlyAdminIntegrations *bool `json:"EnableOnlyAdminIntegrations"` // This field is deprecated and must not be used.
EnablePostUsernameOverride bool EnablePostUsernameOverride bool
EnablePostIconOverride bool EnablePostIconOverride bool
EnableLinkPreviews *bool EnableLinkPreviews *bool
@@ -252,9 +252,9 @@ type ServiceSettings struct {
EnableGifPicker *bool EnableGifPicker *bool
GfycatApiKey *string GfycatApiKey *string
GfycatApiSecret *string GfycatApiSecret *string
RestrictCustomEmojiCreation *string DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation *string `json:"RestrictCustomEmojiCreation"` // This field is deprecated and must not be used.
RestrictPostDelete *string DEPRECATED_DO_NOT_USE_RestrictPostDelete *string `json:"RestrictPostDelete"` // This field is deprecated and must not be used.
AllowEditPost *string DEPRECATED_DO_NOT_USE_AllowEditPost *string `json:"AllowEditPost"` // This field is deprecated and must not be used.
PostEditTimeLimit *int PostEditTimeLimit *int
TimeBetweenUserTypingUpdatesMilliseconds *int64 TimeBetweenUserTypingUpdatesMilliseconds *int64
EnablePostSearch *bool EnablePostSearch *bool
@@ -447,8 +447,8 @@ func (s *ServiceSettings) SetDefaults() {
s.EnableCommands = NewBool(false) s.EnableCommands = NewBool(false)
} }
if s.EnableOnlyAdminIntegrations == nil { if s.DEPRECATED_DO_NOT_USE_EnableOnlyAdminIntegrations == nil {
s.EnableOnlyAdminIntegrations = NewBool(true) s.DEPRECATED_DO_NOT_USE_EnableOnlyAdminIntegrations = NewBool(true)
} }
if s.WebsocketPort == nil { if s.WebsocketPort == nil {
@@ -505,16 +505,16 @@ func (s *ServiceSettings) SetDefaults() {
s.GfycatApiSecret = NewString(SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET) s.GfycatApiSecret = NewString(SERVICE_SETTINGS_DEFAULT_GFYCAT_API_SECRET)
} }
if s.RestrictCustomEmojiCreation == nil { if s.DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation == nil {
s.RestrictCustomEmojiCreation = NewString(RESTRICT_EMOJI_CREATION_ALL) s.DEPRECATED_DO_NOT_USE_RestrictCustomEmojiCreation = NewString(RESTRICT_EMOJI_CREATION_ALL)
} }
if s.RestrictPostDelete == nil { if s.DEPRECATED_DO_NOT_USE_RestrictPostDelete == nil {
s.RestrictPostDelete = NewString(PERMISSIONS_DELETE_POST_ALL) s.DEPRECATED_DO_NOT_USE_RestrictPostDelete = NewString(PERMISSIONS_DELETE_POST_ALL)
} }
if s.AllowEditPost == nil { if s.DEPRECATED_DO_NOT_USE_AllowEditPost == nil {
s.AllowEditPost = NewString(ALLOW_EDIT_POST_ALWAYS) s.DEPRECATED_DO_NOT_USE_AllowEditPost = NewString(ALLOW_EDIT_POST_ALWAYS)
} }
if s.ExperimentalEnableAuthenticationTransfer == nil { if s.ExperimentalEnableAuthenticationTransfer == nil {
@@ -1145,37 +1145,37 @@ func (s *ThemeSettings) SetDefaults() {
} }
type TeamSettings struct { type TeamSettings struct {
SiteName string SiteName string
MaxUsersPerTeam *int MaxUsersPerTeam *int
EnableTeamCreation *bool DEPRECATED_DO_NOT_USE_EnableTeamCreation *bool `json:"EnableTeamCreation"` // This field is deprecated and must not be used.
EnableUserCreation *bool EnableUserCreation *bool
EnableOpenServer *bool EnableOpenServer *bool
EnableUserDeactivation *bool EnableUserDeactivation *bool
RestrictCreationToDomains string RestrictCreationToDomains string
EnableCustomBrand *bool EnableCustomBrand *bool
CustomBrandText *string CustomBrandText *string
CustomDescriptionText *string CustomDescriptionText *string
RestrictDirectMessage *string RestrictDirectMessage *string
RestrictTeamInvite *string DEPRECATED_DO_NOT_USE_RestrictTeamInvite *string `json:"RestrictTeamInvite"` // This field is deprecated and must not be used.
RestrictPublicChannelManagement *string DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement *string `json:"RestrictPublicChannelManagement"` // This field is deprecated and must not be used.
RestrictPrivateChannelManagement *string DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement *string `json:"RestrictPrivateChannelManagement"` // This field is deprecated and must not be used.
RestrictPublicChannelCreation *string DEPRECATED_DO_NOT_USE_RestrictPublicChannelCreation *string `json:"RestrictPublicChannelCreation"` // This field is deprecated and must not be used.
RestrictPrivateChannelCreation *string DEPRECATED_DO_NOT_USE_RestrictPrivateChannelCreation *string `json:"RestrictPrivateChannelCreation"` // This field is deprecated and must not be used.
RestrictPublicChannelDeletion *string DEPRECATED_DO_NOT_USE_RestrictPublicChannelDeletion *string `json:"RestrictPublicChannelDeletion"` // This field is deprecated and must not be used.
RestrictPrivateChannelDeletion *string DEPRECATED_DO_NOT_USE_RestrictPrivateChannelDeletion *string `json:"RestrictPrivateChannelDeletion"` // This field is deprecated and must not be used.
RestrictPrivateChannelManageMembers *string DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManageMembers *string `json:"RestrictPrivateChannelManageMembers"` // This field is deprecated and must not be used.
EnableXToLeaveChannelsFromLHS *bool EnableXToLeaveChannelsFromLHS *bool
UserStatusAwayTimeout *int64 UserStatusAwayTimeout *int64
MaxChannelsPerTeam *int64 MaxChannelsPerTeam *int64
MaxNotificationsPerChannel *int64 MaxNotificationsPerChannel *int64
EnableConfirmNotificationsToChannel *bool EnableConfirmNotificationsToChannel *bool
TeammateNameDisplay *string TeammateNameDisplay *string
ExperimentalViewArchivedChannels *bool ExperimentalViewArchivedChannels *bool
ExperimentalEnableAutomaticReplies *bool ExperimentalEnableAutomaticReplies *bool
ExperimentalHideTownSquareinLHS *bool ExperimentalHideTownSquareinLHS *bool
ExperimentalTownSquareIsReadOnly *bool ExperimentalTownSquareIsReadOnly *bool
ExperimentalPrimaryTeam *string ExperimentalPrimaryTeam *string
ExperimentalDefaultChannels []string ExperimentalDefaultChannels []string
} }
func (s *TeamSettings) SetDefaults() { func (s *TeamSettings) SetDefaults() {
@@ -1207,49 +1207,49 @@ func (s *TeamSettings) SetDefaults() {
s.RestrictDirectMessage = NewString(DIRECT_MESSAGE_ANY) s.RestrictDirectMessage = NewString(DIRECT_MESSAGE_ANY)
} }
if s.RestrictTeamInvite == nil { if s.DEPRECATED_DO_NOT_USE_RestrictTeamInvite == nil {
s.RestrictTeamInvite = NewString(PERMISSIONS_ALL) s.DEPRECATED_DO_NOT_USE_RestrictTeamInvite = NewString(PERMISSIONS_ALL)
} }
if s.RestrictPublicChannelManagement == nil { if s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement == nil {
s.RestrictPublicChannelManagement = NewString(PERMISSIONS_ALL) s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement = NewString(PERMISSIONS_ALL)
} }
if s.RestrictPrivateChannelManagement == nil { if s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement == nil {
s.RestrictPrivateChannelManagement = NewString(PERMISSIONS_ALL) s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement = NewString(PERMISSIONS_ALL)
} }
if s.RestrictPublicChannelCreation == nil { if s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelCreation == nil {
s.RestrictPublicChannelCreation = new(string) s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelCreation = new(string)
// If this setting does not exist, assume migration from <3.6, so use management setting as default. // If this setting does not exist, assume migration from <3.6, so use management setting as default.
if *s.RestrictPublicChannelManagement == PERMISSIONS_CHANNEL_ADMIN { if *s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement == PERMISSIONS_CHANNEL_ADMIN {
*s.RestrictPublicChannelCreation = PERMISSIONS_TEAM_ADMIN *s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelCreation = PERMISSIONS_TEAM_ADMIN
} else { } else {
*s.RestrictPublicChannelCreation = *s.RestrictPublicChannelManagement *s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelCreation = *s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement
} }
} }
if s.RestrictPrivateChannelCreation == nil { if s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelCreation == nil {
// If this setting does not exist, assume migration from <3.6, so use management setting as default. // If this setting does not exist, assume migration from <3.6, so use management setting as default.
if *s.RestrictPrivateChannelManagement == PERMISSIONS_CHANNEL_ADMIN { if *s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement == PERMISSIONS_CHANNEL_ADMIN {
s.RestrictPrivateChannelCreation = NewString(PERMISSIONS_TEAM_ADMIN) s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelCreation = NewString(PERMISSIONS_TEAM_ADMIN)
} else { } else {
s.RestrictPrivateChannelCreation = NewString(*s.RestrictPrivateChannelManagement) s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelCreation = NewString(*s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement)
} }
} }
if s.RestrictPublicChannelDeletion == nil { if s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelDeletion == nil {
// If this setting does not exist, assume migration from <3.6, so use management setting as default. // If this setting does not exist, assume migration from <3.6, so use management setting as default.
s.RestrictPublicChannelDeletion = NewString(*s.RestrictPublicChannelManagement) s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelDeletion = NewString(*s.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement)
} }
if s.RestrictPrivateChannelDeletion == nil { if s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelDeletion == nil {
// If this setting does not exist, assume migration from <3.6, so use management setting as default. // If this setting does not exist, assume migration from <3.6, so use management setting as default.
s.RestrictPrivateChannelDeletion = NewString(*s.RestrictPrivateChannelManagement) s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelDeletion = NewString(*s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement)
} }
if s.RestrictPrivateChannelManageMembers == nil { if s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManageMembers == nil {
s.RestrictPrivateChannelManageMembers = NewString(PERMISSIONS_ALL) s.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManageMembers = NewString(PERMISSIONS_ALL)
} }
if s.EnableXToLeaveChannelsFromLHS == nil { if s.EnableXToLeaveChannelsFromLHS == nil {
@@ -1292,8 +1292,8 @@ func (s *TeamSettings) SetDefaults() {
s.ExperimentalDefaultChannels = []string{} s.ExperimentalDefaultChannels = []string{}
} }
if s.EnableTeamCreation == nil { if s.DEPRECATED_DO_NOT_USE_EnableTeamCreation == nil {
s.EnableTeamCreation = NewBool(true) s.DEPRECATED_DO_NOT_USE_EnableTeamCreation = NewBool(true)
} }
if s.EnableUserCreation == nil { if s.EnableUserCreation == nil {

Просмотреть файл

@@ -9,7 +9,7 @@ import (
func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Config, isLicensed bool) map[string]*model.Role { func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Config, isLicensed bool) map[string]*model.Role {
if isLicensed { if isLicensed {
switch *cfg.TeamSettings.RestrictPublicChannelCreation { switch *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPublicChannelCreation {
case model.PERMISSIONS_ALL: case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append( roles[model.TEAM_USER_ROLE_ID].Permissions = append(
roles[model.TEAM_USER_ROLE_ID].Permissions, roles[model.TEAM_USER_ROLE_ID].Permissions,
@@ -29,7 +29,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
} }
if isLicensed { if isLicensed {
switch *cfg.TeamSettings.RestrictPublicChannelManagement { switch *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPublicChannelManagement {
case model.PERMISSIONS_ALL: case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append( roles[model.TEAM_USER_ROLE_ID].Permissions = append(
roles[model.TEAM_USER_ROLE_ID].Permissions, roles[model.TEAM_USER_ROLE_ID].Permissions,
@@ -58,7 +58,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
} }
if isLicensed { if isLicensed {
switch *cfg.TeamSettings.RestrictPublicChannelDeletion { switch *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPublicChannelDeletion {
case model.PERMISSIONS_ALL: case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append( roles[model.TEAM_USER_ROLE_ID].Permissions = append(
roles[model.TEAM_USER_ROLE_ID].Permissions, roles[model.TEAM_USER_ROLE_ID].Permissions,
@@ -87,7 +87,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
} }
if isLicensed { if isLicensed {
switch *cfg.TeamSettings.RestrictPrivateChannelCreation { switch *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelCreation {
case model.PERMISSIONS_ALL: case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append( roles[model.TEAM_USER_ROLE_ID].Permissions = append(
roles[model.TEAM_USER_ROLE_ID].Permissions, roles[model.TEAM_USER_ROLE_ID].Permissions,
@@ -107,7 +107,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
} }
if isLicensed { if isLicensed {
switch *cfg.TeamSettings.RestrictPrivateChannelManagement { switch *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManagement {
case model.PERMISSIONS_ALL: case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append( roles[model.TEAM_USER_ROLE_ID].Permissions = append(
roles[model.TEAM_USER_ROLE_ID].Permissions, roles[model.TEAM_USER_ROLE_ID].Permissions,
@@ -136,7 +136,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
} }
if isLicensed { if isLicensed {
switch *cfg.TeamSettings.RestrictPrivateChannelDeletion { switch *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelDeletion {
case model.PERMISSIONS_ALL: case model.PERMISSIONS_ALL:
roles[model.TEAM_USER_ROLE_ID].Permissions = append( roles[model.TEAM_USER_ROLE_ID].Permissions = append(
roles[model.TEAM_USER_ROLE_ID].Permissions, roles[model.TEAM_USER_ROLE_ID].Permissions,
@@ -166,7 +166,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
// Restrict permissions for Private Channel Manage Members // Restrict permissions for Private Channel Manage Members
if isLicensed { if isLicensed {
switch *cfg.TeamSettings.RestrictPrivateChannelManageMembers { switch *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictPrivateChannelManageMembers {
case model.PERMISSIONS_ALL: case model.PERMISSIONS_ALL:
roles[model.CHANNEL_USER_ROLE_ID].Permissions = append( roles[model.CHANNEL_USER_ROLE_ID].Permissions = append(
roles[model.CHANNEL_USER_ROLE_ID].Permissions, roles[model.CHANNEL_USER_ROLE_ID].Permissions,
@@ -194,7 +194,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
) )
} }
if !*cfg.ServiceSettings.EnableOnlyAdminIntegrations { if !*cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_EnableOnlyAdminIntegrations {
roles[model.TEAM_USER_ROLE_ID].Permissions = append( roles[model.TEAM_USER_ROLE_ID].Permissions = append(
roles[model.TEAM_USER_ROLE_ID].Permissions, roles[model.TEAM_USER_ROLE_ID].Permissions,
model.PERMISSION_MANAGE_WEBHOOKS.Id, model.PERMISSION_MANAGE_WEBHOOKS.Id,
@@ -208,13 +208,13 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
// Grant permissions for inviting and adding users to a team. // Grant permissions for inviting and adding users to a team.
if isLicensed { if isLicensed {
if *cfg.TeamSettings.RestrictTeamInvite == model.PERMISSIONS_TEAM_ADMIN { if *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictTeamInvite == model.PERMISSIONS_TEAM_ADMIN {
roles[model.TEAM_ADMIN_ROLE_ID].Permissions = append( roles[model.TEAM_ADMIN_ROLE_ID].Permissions = append(
roles[model.TEAM_ADMIN_ROLE_ID].Permissions, roles[model.TEAM_ADMIN_ROLE_ID].Permissions,
model.PERMISSION_INVITE_USER.Id, model.PERMISSION_INVITE_USER.Id,
model.PERMISSION_ADD_USER_TO_TEAM.Id, model.PERMISSION_ADD_USER_TO_TEAM.Id,
) )
} else if *cfg.TeamSettings.RestrictTeamInvite == model.PERMISSIONS_ALL { } else if *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_RestrictTeamInvite == model.PERMISSIONS_ALL {
roles[model.TEAM_USER_ROLE_ID].Permissions = append( roles[model.TEAM_USER_ROLE_ID].Permissions = append(
roles[model.TEAM_USER_ROLE_ID].Permissions, roles[model.TEAM_USER_ROLE_ID].Permissions,
model.PERMISSION_INVITE_USER.Id, model.PERMISSION_INVITE_USER.Id,
@@ -230,7 +230,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
} }
if isLicensed { if isLicensed {
switch *cfg.ServiceSettings.RestrictPostDelete { switch *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_RestrictPostDelete {
case model.PERMISSIONS_DELETE_POST_ALL: case model.PERMISSIONS_DELETE_POST_ALL:
roles[model.CHANNEL_USER_ROLE_ID].Permissions = append( roles[model.CHANNEL_USER_ROLE_ID].Permissions = append(
roles[model.CHANNEL_USER_ROLE_ID].Permissions, roles[model.CHANNEL_USER_ROLE_ID].Permissions,
@@ -260,7 +260,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
) )
} }
if *cfg.TeamSettings.EnableTeamCreation { if *cfg.TeamSettings.DEPRECATED_DO_NOT_USE_EnableTeamCreation {
roles[model.SYSTEM_USER_ROLE_ID].Permissions = append( roles[model.SYSTEM_USER_ROLE_ID].Permissions = append(
roles[model.SYSTEM_USER_ROLE_ID].Permissions, roles[model.SYSTEM_USER_ROLE_ID].Permissions,
model.PERMISSION_CREATE_TEAM.Id, model.PERMISSION_CREATE_TEAM.Id,
@@ -268,7 +268,7 @@ func SetRolePermissionsFromConfig(roles map[string]*model.Role, cfg *model.Confi
} }
if isLicensed { if isLicensed {
switch *cfg.ServiceSettings.AllowEditPost { switch *cfg.ServiceSettings.DEPRECATED_DO_NOT_USE_AllowEditPost {
case model.ALLOW_EDIT_POST_ALWAYS, model.ALLOW_EDIT_POST_TIME_LIMIT: case model.ALLOW_EDIT_POST_ALWAYS, model.ALLOW_EDIT_POST_TIME_LIMIT:
roles[model.CHANNEL_USER_ROLE_ID].Permissions = append( roles[model.CHANNEL_USER_ROLE_ID].Permissions = append(
roles[model.CHANNEL_USER_ROLE_ID].Permissions, roles[model.CHANNEL_USER_ROLE_ID].Permissions,

Просмотреть файл

@@ -82,7 +82,7 @@ func TestSetRolePermissionsFromConfig(t *testing.T) {
for policyValue, rolesMappings := range v { for policyValue, rolesMappings := range v {
config := mockConfig() config := mockConfig()
updateConfig(config, policyName, policyValue) updateConfig(config, "DEPRECATED_DO_NOT_USE_"+policyName, policyValue)
roles := model.MakeDefaultRoles() roles := model.MakeDefaultRoles()
SetRolePermissionsFromConfig(roles, config, true) SetRolePermissionsFromConfig(roles, config, true)

Просмотреть файл

@@ -518,14 +518,6 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L
props["WebsocketURL"] = strings.TrimRight(*c.ServiceSettings.WebsocketURL, "/") props["WebsocketURL"] = strings.TrimRight(*c.ServiceSettings.WebsocketURL, "/")
props["EnableUserDeactivation"] = strconv.FormatBool(*c.TeamSettings.EnableUserDeactivation) props["EnableUserDeactivation"] = strconv.FormatBool(*c.TeamSettings.EnableUserDeactivation)
props["RestrictDirectMessage"] = *c.TeamSettings.RestrictDirectMessage props["RestrictDirectMessage"] = *c.TeamSettings.RestrictDirectMessage
props["RestrictTeamInvite"] = *c.TeamSettings.RestrictTeamInvite
props["RestrictPublicChannelCreation"] = *c.TeamSettings.RestrictPublicChannelCreation
props["RestrictPrivateChannelCreation"] = *c.TeamSettings.RestrictPrivateChannelCreation
props["RestrictPublicChannelManagement"] = *c.TeamSettings.RestrictPublicChannelManagement
props["RestrictPrivateChannelManagement"] = *c.TeamSettings.RestrictPrivateChannelManagement
props["RestrictPublicChannelDeletion"] = *c.TeamSettings.RestrictPublicChannelDeletion
props["RestrictPrivateChannelDeletion"] = *c.TeamSettings.RestrictPrivateChannelDeletion
props["RestrictPrivateChannelManageMembers"] = *c.TeamSettings.RestrictPrivateChannelManageMembers
props["EnableXToLeaveChannelsFromLHS"] = strconv.FormatBool(*c.TeamSettings.EnableXToLeaveChannelsFromLHS) props["EnableXToLeaveChannelsFromLHS"] = strconv.FormatBool(*c.TeamSettings.EnableXToLeaveChannelsFromLHS)
props["TeammateNameDisplay"] = *c.TeamSettings.TeammateNameDisplay props["TeammateNameDisplay"] = *c.TeamSettings.TeammateNameDisplay
props["ExperimentalPrimaryTeam"] = *c.TeamSettings.ExperimentalPrimaryTeam props["ExperimentalPrimaryTeam"] = *c.TeamSettings.ExperimentalPrimaryTeam
@@ -536,15 +528,12 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L
props["EnableIncomingWebhooks"] = strconv.FormatBool(c.ServiceSettings.EnableIncomingWebhooks) props["EnableIncomingWebhooks"] = strconv.FormatBool(c.ServiceSettings.EnableIncomingWebhooks)
props["EnableOutgoingWebhooks"] = strconv.FormatBool(c.ServiceSettings.EnableOutgoingWebhooks) props["EnableOutgoingWebhooks"] = strconv.FormatBool(c.ServiceSettings.EnableOutgoingWebhooks)
props["EnableCommands"] = strconv.FormatBool(*c.ServiceSettings.EnableCommands) props["EnableCommands"] = strconv.FormatBool(*c.ServiceSettings.EnableCommands)
props["EnableOnlyAdminIntegrations"] = strconv.FormatBool(*c.ServiceSettings.EnableOnlyAdminIntegrations)
props["EnablePostUsernameOverride"] = strconv.FormatBool(c.ServiceSettings.EnablePostUsernameOverride) props["EnablePostUsernameOverride"] = strconv.FormatBool(c.ServiceSettings.EnablePostUsernameOverride)
props["EnablePostIconOverride"] = strconv.FormatBool(c.ServiceSettings.EnablePostIconOverride) props["EnablePostIconOverride"] = strconv.FormatBool(c.ServiceSettings.EnablePostIconOverride)
props["EnableUserAccessTokens"] = strconv.FormatBool(*c.ServiceSettings.EnableUserAccessTokens) props["EnableUserAccessTokens"] = strconv.FormatBool(*c.ServiceSettings.EnableUserAccessTokens)
props["EnableLinkPreviews"] = strconv.FormatBool(*c.ServiceSettings.EnableLinkPreviews) props["EnableLinkPreviews"] = strconv.FormatBool(*c.ServiceSettings.EnableLinkPreviews)
props["EnableTesting"] = strconv.FormatBool(c.ServiceSettings.EnableTesting) props["EnableTesting"] = strconv.FormatBool(c.ServiceSettings.EnableTesting)
props["EnableDeveloper"] = strconv.FormatBool(*c.ServiceSettings.EnableDeveloper) props["EnableDeveloper"] = strconv.FormatBool(*c.ServiceSettings.EnableDeveloper)
props["RestrictPostDelete"] = *c.ServiceSettings.RestrictPostDelete
props["AllowEditPost"] = *c.ServiceSettings.AllowEditPost
props["PostEditTimeLimit"] = fmt.Sprintf("%v", *c.ServiceSettings.PostEditTimeLimit) props["PostEditTimeLimit"] = fmt.Sprintf("%v", *c.ServiceSettings.PostEditTimeLimit)
props["CloseUnusedDirectMessages"] = strconv.FormatBool(*c.ServiceSettings.CloseUnusedDirectMessages) props["CloseUnusedDirectMessages"] = strconv.FormatBool(*c.ServiceSettings.CloseUnusedDirectMessages)
props["EnablePreviewFeatures"] = strconv.FormatBool(*c.ServiceSettings.EnablePreviewFeatures) props["EnablePreviewFeatures"] = strconv.FormatBool(*c.ServiceSettings.EnablePreviewFeatures)
@@ -583,7 +572,6 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L
props["EnableGifPicker"] = strconv.FormatBool(*c.ServiceSettings.EnableGifPicker) props["EnableGifPicker"] = strconv.FormatBool(*c.ServiceSettings.EnableGifPicker)
props["GfycatApiKey"] = *c.ServiceSettings.GfycatApiKey props["GfycatApiKey"] = *c.ServiceSettings.GfycatApiKey
props["GfycatApiSecret"] = *c.ServiceSettings.GfycatApiSecret props["GfycatApiSecret"] = *c.ServiceSettings.GfycatApiSecret
props["RestrictCustomEmojiCreation"] = *c.ServiceSettings.RestrictCustomEmojiCreation
props["MaxFileSize"] = strconv.FormatInt(*c.FileSettings.MaxFileSize, 10) props["MaxFileSize"] = strconv.FormatInt(*c.FileSettings.MaxFileSize, 10)
props["MaxNotificationsPerChannel"] = strconv.FormatInt(*c.TeamSettings.MaxNotificationsPerChannel, 10) props["MaxNotificationsPerChannel"] = strconv.FormatInt(*c.TeamSettings.MaxNotificationsPerChannel, 10)
@@ -719,7 +707,6 @@ func GenerateLimitedClientConfig(c *model.Config, diagnosticId string, license *
props["BuildEnterpriseReady"] = model.BuildEnterpriseReady props["BuildEnterpriseReady"] = model.BuildEnterpriseReady
props["SiteName"] = c.TeamSettings.SiteName props["SiteName"] = c.TeamSettings.SiteName
props["EnableTeamCreation"] = strconv.FormatBool(*c.TeamSettings.EnableTeamCreation)
props["EnableUserCreation"] = strconv.FormatBool(*c.TeamSettings.EnableUserCreation) props["EnableUserCreation"] = strconv.FormatBool(*c.TeamSettings.EnableUserCreation)
props["EnableOpenServer"] = strconv.FormatBool(*c.TeamSettings.EnableOpenServer) props["EnableOpenServer"] = strconv.FormatBool(*c.TeamSettings.EnableOpenServer)