diff --git a/e2e-tests/playwright/lib/src/server/default_config.ts b/e2e-tests/playwright/lib/src/server/default_config.ts index b88eff4139..41674f5d57 100644 --- a/e2e-tests/playwright/lib/src/server/default_config.ts +++ b/e2e-tests/playwright/lib/src/server/default_config.ts @@ -202,6 +202,7 @@ const defaultServerConfig: AdminConfig = { ScheduledPosts: true, EnableWebHubChannelIteration: false, FrameAncestors: '', + DeleteAccountLink: '', }, TeamSettings: { SiteName: 'Mattermost', diff --git a/server/config/client.go b/server/config/client.go index c67d470743..fa96bca1ab 100644 --- a/server/config/client.go +++ b/server/config/client.go @@ -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" diff --git a/server/public/model/config.go b/server/public/model/config.go index 2f0387b692..5de3651f63 100644 --- a/server/public/model/config.go +++ b/server/public/model/config.go @@ -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 { diff --git a/webapp/channels/src/components/admin_console/admin_definition.tsx b/webapp/channels/src/components/admin_console/admin_definition.tsx index 2e18f65fc2..62863ee82e 100644 --- a/webapp/channels/src/components/admin_console/admin_definition.tsx +++ b/webapp/channels/src/components/admin_console/admin_definition.tsx @@ -2672,6 +2672,14 @@ const AdminDefinition: AdminDefinitionType = { placeholder: defineMessage({id: 'admin.team.refreshPostStatsRunTimeExample', defaultMessage: 'E.g.: "00:00"'}), isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.USERS_AND_TEAMS)), }, + { + type: 'text', + key: 'ServiceSettings.DeleteAccountLink', + label: defineMessage({id: 'admin.team.deleteAccountTitle', defaultMessage: 'Delete Account Link:'}), + help_text: defineMessage({id: 'admin.team.deleteAccountDesc', defaultMessage: 'The URL for the Delete Account link in the Security tab of Profile Settings. If this field is empty, the Delete Account link is hidden from users.'}), + isDisabled: it.not(it.userHasWritePermissionOnResource(RESOURCE_KEYS.SITE.CUSTOMIZATION)), + isHidden: it.licensedForFeature('Cloud'), + }, ], }, }, diff --git a/webapp/channels/src/components/user_settings/security/__snapshots__/user_settings_security.test.tsx.snap b/webapp/channels/src/components/user_settings/security/__snapshots__/user_settings_security.test.tsx.snap index 92b4357707..d05cf05d19 100644 --- a/webapp/channels/src/components/user_settings/security/__snapshots__/user_settings_security.test.tsx.snap +++ b/webapp/channels/src/components/user_settings/security/__snapshots__/user_settings_security.test.tsx.snap @@ -108,7 +108,7 @@ exports[`components/user_settings/display/UserSettingsDisplay should match snaps >