mirror of https://github.com/zulip/zulip.git
settings: Add 'allow_private_data_export' user setting.
This commit adds a user-setting to allow users to decide whether to let administrators export their private data. Fixes part of #31201.
This commit is contained in:
parent
fb888ba9ab
commit
764083d31b
|
@ -20,6 +20,12 @@ format used by the Zulip server that they are interacting with.
|
|||
|
||||
## Changes in Zulip 10.0
|
||||
|
||||
**Feature level 293**
|
||||
|
||||
* [`POST /register`](/api/register-queue), [`PATCH /settings`](/api/update-settings):
|
||||
Added a new `allow_private_data_export` setting to allow users to decide
|
||||
whether to let administrators export their private data.
|
||||
|
||||
**Feature level 292**
|
||||
|
||||
* [`POST /register`](/api/register-queue), [`GET
|
||||
|
|
|
@ -34,7 +34,7 @@ DESKTOP_WARNING_VERSION = "5.9.3"
|
|||
# new level means in api_docs/changelog.md, as well as "**Changes**"
|
||||
# entries in the endpoint's documentation in `zulip.yaml`.
|
||||
|
||||
API_FEATURE_LEVEL = 292 # Last bumped for `namedusergroup_creator_date_created`.
|
||||
API_FEATURE_LEVEL = 293 # Last bumped for `allow_private_data_export` setting.
|
||||
|
||||
# Bump the minor PROVISION_VERSION to indicate that folks should provision
|
||||
# only when going from an old version of the code to a newer version. Bump
|
||||
|
|
|
@ -3,6 +3,7 @@ import {z} from "zod";
|
|||
import type {StateData} from "./state_data";
|
||||
|
||||
export const realm_default_settings_schema = z.object({
|
||||
allow_private_data_export: z.boolean(),
|
||||
automatically_follow_topics_policy: z.number(),
|
||||
automatically_follow_topics_where_mentioned: z.boolean(),
|
||||
automatically_unmute_topics_in_muted_streams_policy: z.number(),
|
||||
|
|
|
@ -717,6 +717,7 @@ export function dispatch_normal_event(event) {
|
|||
"send_read_receipts",
|
||||
"presence_enabled",
|
||||
"email_address_visibility",
|
||||
"allow_private_data_export",
|
||||
];
|
||||
|
||||
if (privacy_settings.includes(event.property)) {
|
||||
|
|
|
@ -29,6 +29,9 @@ export let settings_label;
|
|||
function setup_settings_label() {
|
||||
settings_label = {
|
||||
// settings_notification
|
||||
allow_private_data_export: $t({
|
||||
defaultMessage: "Let administrators export my private data",
|
||||
}),
|
||||
presence_enabled: $t({
|
||||
defaultMessage: "Display my availability to other users",
|
||||
}),
|
||||
|
|
|
@ -34,6 +34,7 @@ export const user_settings_schema = stream_notification_settings_schema
|
|||
.merge(pm_notification_settings_schema)
|
||||
.merge(followed_topic_notification_settings_schema)
|
||||
.extend({
|
||||
allow_private_data_export: z.boolean(),
|
||||
automatically_follow_topics_policy: z.number(),
|
||||
automatically_follow_topics_where_mentioned: z.boolean(),
|
||||
automatically_unmute_topics_in_muted_streams_policy: z.number(),
|
||||
|
|
|
@ -94,6 +94,12 @@
|
|||
label_parens_text=settings_label.presence_enabled_parens_text
|
||||
help_link="/help/status-and-availability"
|
||||
prefix="user_"}}
|
||||
{{> settings_checkbox
|
||||
setting_name="allow_private_data_export"
|
||||
is_checked=settings_object.allow_private_data_export
|
||||
label=settings_label.allow_private_data_export
|
||||
help_link="/help/export-your-organization#full-export-with-member-consent"
|
||||
}}
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label for="email_address_visibility" class="settings-field-label">{{t "Who can access your email address" }}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
# Generated by Django 5.0.8 on 2024-09-09 08:57
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("zerver", "0584_namedusergroup_creator_date_created_backfill"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="realmuserdefault",
|
||||
name="allow_private_data_export",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="userprofile",
|
||||
name="allow_private_data_export",
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
|
@ -267,6 +267,7 @@ class UserBaseSettings(models.Model):
|
|||
send_stream_typing_notifications = models.BooleanField(default=True)
|
||||
send_private_typing_notifications = models.BooleanField(default=True)
|
||||
send_read_receipts = models.BooleanField(default=True)
|
||||
allow_private_data_export = models.BooleanField(default=False)
|
||||
|
||||
# Whether the user wants to see typing notifications.
|
||||
receives_typing_notifications = models.BooleanField(default=True)
|
||||
|
@ -347,6 +348,7 @@ class UserBaseSettings(models.Model):
|
|||
send_private_typing_notifications=bool,
|
||||
send_read_receipts=bool,
|
||||
send_stream_typing_notifications=bool,
|
||||
allow_private_data_export=bool,
|
||||
web_mark_read_on_scroll_policy=int,
|
||||
web_channel_default_view=int,
|
||||
user_list_style=int,
|
||||
|
|
|
@ -14873,6 +14873,13 @@ paths:
|
|||
read messages.
|
||||
|
||||
**Changes**: New in Zulip 5.0 (feature level 105).
|
||||
allow_private_data_export:
|
||||
type: boolean
|
||||
description: |
|
||||
Whether organization administrators are allowed to
|
||||
export your private data.
|
||||
|
||||
**Changes**: New in Zulip 10.0 (feature level 293).
|
||||
email_address_visibility:
|
||||
$ref: "#/components/schemas/EmailAddressVisibility"
|
||||
web_navigate_to_sent_message:
|
||||
|
@ -17370,6 +17377,13 @@ paths:
|
|||
read messages.
|
||||
|
||||
**Changes**: New in Zulip 5.0 (feature level 105).
|
||||
allow_private_data_export:
|
||||
type: boolean
|
||||
description: |
|
||||
Whether organization administrators are allowed to
|
||||
export your private data.
|
||||
|
||||
**Changes**: New in Zulip 10.0 (feature level 293).
|
||||
email_address_visibility:
|
||||
$ref: "#/components/schemas/EmailAddressVisibility"
|
||||
web_navigate_to_sent_message:
|
||||
|
@ -18672,6 +18686,14 @@ paths:
|
|||
**Changes**: New in Zulip 5.0 (feature level 105).
|
||||
type: boolean
|
||||
example: true
|
||||
allow_private_data_export:
|
||||
description: |
|
||||
Whether organization administrators are allowed to
|
||||
export your private data.
|
||||
|
||||
**Changes**: New in Zulip 10.0 (feature level 293).
|
||||
type: boolean
|
||||
example: true
|
||||
email_address_visibility:
|
||||
description: |
|
||||
The [policy][permission-level] this user has selected for [which other
|
||||
|
@ -18807,6 +18829,8 @@ paths:
|
|||
contentType: application/json
|
||||
send_read_receipts:
|
||||
contentType: application/json
|
||||
allow_private_data_export:
|
||||
contentType: application/json
|
||||
email_address_visibility:
|
||||
contentType: application/json
|
||||
web_navigate_to_sent_message:
|
||||
|
|
|
@ -2175,7 +2175,12 @@ class RealmAPITest(ZulipTestCase):
|
|||
# duplicate code. default_language is currently present in Realm table also and thus
|
||||
# is updated using '/realm' endpoint, but this will be removed in future and the
|
||||
# settings in RealmUserDefault table will be used.
|
||||
if prop in ["default_language", "enable_login_emails", "enable_marketing_emails"]:
|
||||
if prop in [
|
||||
"default_language",
|
||||
"enable_login_emails",
|
||||
"enable_marketing_emails",
|
||||
"allow_private_data_export",
|
||||
]:
|
||||
continue
|
||||
if prop in ["dense_mode"]:
|
||||
# Testing this is complicated, see test_update_default_information_density_settings.
|
||||
|
|
|
@ -314,6 +314,7 @@ def json_change_settings(
|
|||
send_private_typing_notifications: Json[bool] | None = None,
|
||||
send_stream_typing_notifications: Json[bool] | None = None,
|
||||
send_read_receipts: Json[bool] | None = None,
|
||||
allow_private_data_export: Json[bool] | None = None,
|
||||
user_list_style: Annotated[
|
||||
Json[int], check_int_in_validator(UserProfile.USER_LIST_STYLE_CHOICES)
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue