Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Disable private data toggle if owner can export w/o consent.

Shubham Padia1852aeeceb9c
diff --git a/web/src/settings.ts b/web/src/settings.ts
index 5ee1402531c..ea17bb4d40b 100644
--- a/web/src/settings.ts
+++ b/web/src/settings.ts
@@ -85,6 +85,14 @@ export function build_page(): void {
...settings_config.preferences_settings_labels,
};
+ const is_export_without_consent_enabled = realm.realm_owner_full_content_access;
+ const private_data_export_tooltip_text = is_export_without_consent_enabled
+ ? $t({
+ defaultMessage:
+ "Administrators of this organization are allowed to export private data for all users.",
+ })
+ : undefined;
+
const rendered_settings_tab = render_settings_tab({
full_name: people.my_full_name(),
profile_picture: people.small_avatar_url_for_person(
@@ -151,6 +159,10 @@ export function build_page(): void {
user_settings.web_line_height_percent,
),
max_user_name_length: people.MAX_USER_NAME_LENGTH,
+ private_data_export_is_checked:
+ user_settings.allow_private_data_export || is_export_without_consent_enabled,
+ private_data_export_is_disabled: is_export_without_consent_enabled,
+ private_data_export_tooltip_text,
});
$(".settings-box").html(rendered_settings_tab);
diff --git a/web/templates/settings/privacy_settings.hbs b/web/templates/settings/privacy_settings.hbs
index 87117a30f31..66237ed9a61 100644
--- a/web/templates/settings/privacy_settings.hbs
+++ b/web/templates/settings/privacy_settings.hbs
@@ -42,7 +42,9 @@
{{#unless for_realm_settings}}
{{> settings_checkbox
setting_name="allow_private_data_export"
- is_checked=settings_object.allow_private_data_export
+ is_checked=private_data_export_is_checked
+ is_disabled=private_data_export_is_disabled
+ tooltip_message=private_data_export_tooltip_text
label=settings_label.allow_private_data_export
help_link="/help/export-your-organization#export-your-organization"
}}