[MM-64425] Add configurable account deletion link (#31396)

* [MM-64425] Add configurable account deletion link

* Fix types

* PR feedback

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Devin Binnie
2025-06-12 11:00:00 -04:00
коммит произвёл GitHub
родитель 6d7a8c6d72
Коммит 74258c3b7a
10 изменённых файлов: 70 добавлений и 13 удалений

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

@@ -52,6 +52,7 @@ func GenerateClientConfig(c *model.Config, telemetryID string, license *model.Li
props["EnableInlineLatex"] = strconv.FormatBool(*c.ServiceSettings.EnableInlineLatex)
props["ExtendSessionLengthWithActivity"] = strconv.FormatBool(*c.ServiceSettings.ExtendSessionLengthWithActivity)
props["ManagedResourcePaths"] = *c.ServiceSettings.ManagedResourcePaths
props["DeleteAccountLink"] = *c.ServiceSettings.DeleteAccountLink
// This setting is only temporary, so keep using the old setting name for the mobile and web apps
props["ExperimentalEnablePostMetadata"] = "true"

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

@@ -454,6 +454,7 @@ type ServiceSettings struct {
ScheduledPosts *bool `access:"site_posts"`
EnableWebHubChannelIteration *bool `access:"write_restrictable,cloud_restrictable"` // telemetry: none
FrameAncestors *string `access:"write_restrictable,cloud_restrictable"` // telemetry: none
DeleteAccountLink *string `access:"site_users_and_teams,write_restrictable,cloud_restrictable"`
}
var MattermostGiphySdkKey string
@@ -989,6 +990,14 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
if s.FrameAncestors == nil {
s.FrameAncestors = NewPointer("")
}
if !isSafeLink(s.DeleteAccountLink) {
*s.DeleteAccountLink = ""
}
if s.DeleteAccountLink == nil {
s.DeleteAccountLink = NewPointer("")
}
}
type CacheSettings struct {