Commit Graph

104 Commits

Author SHA1 Message Date
Anders Kaseorg
40a022dcc3 zephyr: Remove Zephyr mirroring support.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-16 11:18:18 -07:00
Saubhagya Patel
bb5c87e306 bots: Add a setting to customize the Welcome Bot message.
This commit includes the following changes:
- Add an administrator setting to customize the Welcome Bot
message when sending an invitation.
- Add an API endpoint to test the customized Welcome Bot message
by sending a copy of the message to the administrator.

Fixes #27663.

Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>
2025-08-08 18:59:37 -07:00
Prakhar Pratyush
fc6cd9a966 settings: Add require_e2ee_push_notifications realm setting.
This commit adds a realm setting:
"Require end-to-end encryption for push notification content".

This commit just involves backend & UI changes to add the setting,
the impact of this setting is in the next commit.

Fixes part of #35370.
2025-07-28 17:06:59 -07:00
Vector73
a02614204a settings: Add can_set_delete_message_policy_group setting.
Adds new organization setting `can_set_delete_message_policy_group`
for defining who can set per-channel message delete permissions.

Fixes #34214.
2025-07-17 15:44:53 -07:00
Sahil Batra
8400c24665 groups: Make two fields of GroupPermissionSetting optional.
This commit makes require_system_group and allow_internet_group
fields of GroupPermissionSetting optional with default value of
False. "allow_internet_group" is False for all of the settings
and "require_system_group" is True for only two settings, so it
is better to not having to repeat them for every setting.
2025-06-23 09:49:11 -07:00
Vector73
92672c1339 settings: Add can_set_topics_policy_group realm setting.
Added `can_set_topics_policy_group` realm setting to control
permission to change per-channel `topics_policy`.
2025-06-17 17:05:58 -07:00
Vector73
62c67eae8e settings: Add a new topics_policy realm setting.
Added a new realm setting, `topics_policy` and deprecated
`mandatory_topics` setting as it now replaced by `topics_policy`.

Fixes part of #33549.
2025-06-17 17:05:58 -07:00
Anders Kaseorg
4e31948f90 requirements: Upgrade django-cte from 1.3.3 to 2.0.0.dev.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-11 16:25:25 -07:00
Tim Abbott
446ba1b538 settings_data: Optimize user_can_access_all_other_users.
This fixes an important issue where this function being called in a
loop can consume as much as 1ms per iteration for users who are in a
lot of groups.
2025-06-06 10:53:03 -07:00
Mateusz Mandera
0c62a2ed4f models: Fix typo in RealmAuthenticationMethod docstring. 2025-06-05 16:08:21 -07:00
PieterCK
0814fb88c1 api: Add a new endpoint for message reporting.
This adds a new API endpoint that enables users to report messages for
review by admins or moderators. Reports will be sent to the
`moderate_request_channel`, so it must be configured for this feature to
be enabled.

Fixes part of #20047.

Co-authored-by: Adam Sah <140002+asah@users.noreply.github.com>
2025-05-06 15:59:55 -07:00
Aman Agrawal
c490b1cbb4 support: Show current billing admins on cloud support page. 2025-03-24 16:00:48 -07:00
Tim Abbott
a4f128f609 models: Change default for can_resolve_topic_group.
It's not obvious why this should be different from the permission for
moving topics.
2025-03-19 17:51:46 -07:00
roanster007
2c548d4856 settings: Allow "resolve topic" permissions to be managed independently.
This commit separates the "resolve topic" permissions from the
topic editing permissions, through the introduction of setting -
"can_resolve_topics_group" which user group whose members
can resolve topics.

Fixes #21811
2025-03-12 19:32:35 -07:00
Tim Abbott
f4bb1ac30f realms: Require a non-empty set of users who can manage billing.
This isn't a configuration that's useful, and it seems marginally
helpful to make it hard to end up in a state where this is the empty
set.
2025-03-10 11:50:22 -07:00
Vector73
158fd58cde settings: Add "can_manage_billing_group" realm setting.
Added "can_manage_billing_group" realm group permission setting
to control who can manage billing and plans in the organization.

Fixes #32745.
2025-03-10 09:36:30 -07:00
Sahil Batra
c2f1b3673e register: Optimize computing realm group setting values.
We do not fetch all the realm group settings using
select_related for register data now since it takes a
lot of time in planning phase. This commit updates
the code to fetch all the members and subgroups data
in user_groups_in_realm_serialized so that we do not
need to access each setting group individually.

user_groups_in_realm_serialized is updated to send the
required data accordingly.

Fixes #33656.
2025-02-27 10:03:28 -08:00
Saubhagya Patel
d0c5c1cacb settings: Add backend to change allow_edit_history to integer field.
This commit implements the backend of migrating the
`allow_edit_history` setting to
`message_edit_history_visibility_policy`.
This allows organizations, to have an intermediate setting to
view only the "Moves" history of the messages.

We still pass `realm_allow_edit_history` in `/register` response
though for older clients with its value being set depending on the
value of `realm_message_edit_history_visibility_policy`. We set
`realm_allow_edit_history` to `False` if the
`realm_message_edit_history_visibility_policy` is "None", and
`True` for "Moves only" or "All" message edit history.

Fixes part of #21398.

Co-authored-by: Shlok Patel <shlokcpatel2001@gmail.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-02-25 18:18:23 -08:00
Tim Abbott
0338fd7357 get_realm_with_settings: Fix unnecessary joins with channel.
We were not actually using anything but the IDs here, so it was a
bunch of wasted work to fetch these.

This essentially reverts f48e87cd3c. At
the time, something like that was required, because we needed to check
if the channel was deactivated before exposing it to the API, but more
recent reworking of the system to change the setting if the channel is
deactivated, rather than masking it in fetch_initial_state_data, means
we can do this cleanup.
2025-02-25 11:42:04 -08:00
Lauryn Menard
8561800676 video-calls: Add Zoom Serverto Server OAuth integration.
Adds a second Zoom integration that uses the Zoom Server to Server
OAuth app process. Only one of the two Zoom integrations can be
configured on a Zulip server.

Adds a cache for the access token from the Zoom server so that it
can be used by the server to create meetings for the approximate
duration of the access token

In the web-app compose box, if the user's delivery email does not
match a user on the configured Zoom account for the server to server
integration, then a compose box error banner will be shown when the
error response is received after clicking/selecting the video or
audio call button.

Also updates the production documentation for the both types of Zoom
integration apps (Server to Server and General). The General app
process for Zoom now requires unlisted apps to go through their
review process, which we now have documented.

Fixes #33117.
2025-02-13 16:35:43 -08:00
Vector73
2ef9695ef0 settings: Migrate wildcard_mention_policy to group-based permission.
Added new group-based permission setting
`can_mention_many_users_group` to replace `wildcard_mention_policy`.
2025-02-12 23:21:33 -08:00
Sahil Batra
4ca28bb850 settings: Add setting to control permission for topic summarization. 2025-02-12 12:05:04 -08:00
Vector73
cb6f0fd63c realm: Add setting to notify user on DMing guest.
Added `enable_guest_user_dm_warning` setting to decide whether
clients should show a warning when a user is composing to a guest
user in the organization.

Fixes #30078.

Co-authored-by: adnan-td <generaladnan139@gmail.com>
2025-02-06 12:15:41 -08:00
Lauryn Menard
f13a1a48f7 realm: Refactor VIDEO_CHAT_PROVIDERS to have all possible options.
Refactors Realm.VIDEO_CHAT_PROIVDERS to have all the possible options
for video chat integrations, and use get_enabled_video_chat_providers
to compute the enabled options for the realm.

Prep for adding Zoom server to server video chat integration.
2025-02-05 13:36:25 -08:00
Prakhar Pratyush
77baa05aa9 streams: Set realm stream fields to NULL when streams are deactivated.
When a stream configured for any of these settings is deactivated,
the corresponding realm settings should be set to NULL:
* new_stream_announcements_stream
* signup_announcements_stream
* zulip_update_announcements_stream
* moderation_request_channel

Earlier, we were not updating those realm settings to NULL.
We had helper functions like 'get_new_stream_announcements_stream'
to return None if the configured stream was deactivated.
But it makes more sense to just set them to NULL in DB.

This commit also includes a migration to clear those fields
if the configured channels are deactivated.
2025-02-05 12:21:55 -08:00
Vector73
a2c3138418 settings: Remove bot_creation_policy setting.
Removed `bot_creation_policy` property, as the permission to create
bot users in the organization is now controlled by two new realm settings,
`can_create_bots_group` and `can_create_write_only_bots_group`
2025-01-30 11:37:35 -08:00
Vector73
d48164ce1e settings: Add two new realm settings to restrict bot creation.
Added `can_create_bots_group` setting which controls who can
create any type of bots in the organization.

Added `can_create_write_only_bots_group` setting which controls
who can create incoming webhooks in the organization in additon
to those who are in `can_create_bots_group`.
2025-01-30 11:37:33 -08:00
Anders Kaseorg
f52ec0559c realms: Use modern union syntax for property_types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-24 23:00:21 -08:00
Anders Kaseorg
73783f5519 realms: Remove None for message_retention_days.
The unlimited value for message_retention_days is -1, not null.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-24 23:00:21 -08:00
Shubham Padia
24341076a3 realm: Delete invite_to_stream_policy. 2025-01-22 12:33:58 -08:00
Shubham Padia
275a1a4c69 realm: Use can_add_subscribers_group instead of invite_to_stream_policy.
We remove `invite_to_stream_policy` from the backend wherever applicable
except deleting the field. We have just ported the existing behaviour of
`invite_to_stream_policy` to `can_add_subscribers_group` except one
change. We have added an explicit exception for admins to have this
permission whether they are part of this group or not. The reason for
this is we are adding `stream.can_add_susbcribers_group` in the future
which will grant all admins permission to subscribe other users to a
channel given they have access to a channel. So it makes sense that we
add this exception to the realm level property also.
See https://chat.zulip.org/#narrow/channel/101-design/topic/Can.20subscribe.20other.20users.20on.20user.20profile/near/2039825
2025-01-22 12:33:58 -08:00
Shubham Padia
3cdc9d8459 realm: Add can_add_subscribers_group as a setting.
This commit just adds the setting, the work to use this setting and
replace `invite_to_stream_policy` will be done in future commits.
2025-01-22 12:33:56 -08:00
opmkumar
5b0c55fda3 realm: Add option to schedule data deletion while deactivating.
Introduce a feature to schedule realm data deletion time during realm
deactivation. This includes a server-level setting to configure the
minimum and maximum allowed deletion days.

Co-authored-by: Ujjawal Modi <umodi2003@gmail.com>
Co-authored-by: Lauryn Menard <lauryn@zulip.com>

Fixes #24677.
2024-12-18 23:06:12 -08:00
PieterCK
943fbb76fe settings: Add realm-level setting moderation_request_channel.
This commit introduces a new non-operational
`moderation_request_channel` field to the server/API. This setting will
support a feature allowing users to flag or report abusive content
(harassment, spam, etc.).

Fixes part of #20047.
2024-12-18 11:36:19 -08:00
Sahil Batra
3319a192d4 realm: Allow various settings to be set to "Nobody" group.
We now allow setting following settings to "Nobody" group -
- can_add_custom_emoji_group
- can_create_groups
- can_create_public_channel_group
- can_create_private_channel_group
- can_delete_any_message_group
- can_delete_own_message_group

We are fine with nobody having these permissions as there
will be no major challenges for working of the organization
with these settings and admins anyways will always have
permission to change these settings.

Fixes #32401.
2024-12-04 11:15:18 -08:00
Sahil Batra
367a0bdbff groups: Remove id_field_name field from GroupPermissionSetting.
id_field_name was being used only to set the initial dummy
values for realm settings. We can directly add "_id" to the
setting name instead of having an extra id_field_name field.
2024-12-04 11:15:17 -08:00
Sahil Batra
121df45cc4 groups: Remove allow_owners_group field from GroupPermissionSetting.
As we now allow anonymous groups and settings can be set to any
set of users, there is no benefit in not allowing a setting to
be set to "Owners" group.
2024-12-04 11:12:28 -08:00
Anders Kaseorg
0048dfabd0 admin: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-27 16:46:35 -08:00
Vector73
de44eb6a1b settings: Remove invite_to_realm_policy setting.
Removed `invite_to_realm_policy` property, as the permission
to invite other users to the organization is now controlled by
`can_invite_users_group` setting.
2024-11-20 13:35:05 -08:00
Vector73
4e89b4a88c settings: Add can_invite_users_group realm setting.
Added `can_invite_users_group` realm setting to replace
`invite_to_realm_policy`.
2024-11-20 13:35:05 -08:00
Prakhar Pratyush
6820cbb980 realm_export: Change tarball_size_bytes to PositiveBigIntegerField.
This commit updates `tarball_size_bytes` field from
`PositiveIntegerField` to `PositiveBigIntegerField` to support
larger values.
2024-11-14 10:09:03 -08:00
Tim Abbott
f54817d78d groups: Enable group-valued settings in production. 2024-10-31 12:04:51 -07:00
Vector73
1ba1408b01 settings: Remove edit_topic_policy setting.
Removed `edit_topic_policy` property, as the permission
to move messages between topcis is now controlled by
`can_move_messages_between_topics_group` setting.
2024-10-29 16:27:04 -07:00
Vector73
ed5638ec3c settings: Add can_move_messages_between_topics_group realm setting.
Added `can_move_messages_between_topics_group` realm setting to replace
`edit_topic_policy`.
2024-10-29 16:27:04 -07:00
Shubham Padia
1f0906aef7 groups: Remove list specifying group settings with new API format.
All the groups are now following the new API format, making the list
redundant.
2024-10-24 14:42:21 -07:00
Shubham Padia
9f9d5b2f98 groups: Accept anonymous groups for can_access_all_users_group.
On the frontend, the selection is still a dropdown of system groups but
on the API level, we have started accepting anonymous groups similar to
other settings
We've kept require system groups true for now until we switch to group
picker on the frontend.
2024-10-24 14:42:19 -07:00
Shubham Padia
ceb0197c1b groups: Accept anonymous groups for create_multiuse_invite_group.
On the frontend, the selection is still a dropdown of system groups but
on the API level, we have started accepting anonymous groups similar to
other settings.
We've kept require system groups true for now until we switch to group
picker on the frontend.
2024-10-24 14:41:09 -07:00
Vector73
8d341d1af9 settings: Remove move_messages_between_streams_policy setting.
Removed `move_messages_between_streams_policy` property, as the permission
to move messages between channels is now controlled by
`can_move_messages_between_channels_group` setting.
2024-10-16 14:26:20 -07:00
Vector73
1be0cb1b75 settings: Add can_move_messages_between_channels_group realm setting.
Added `can_move_messages_between_channels_group` realm setting to replace
`move_messages_between_streams_policy`.
2024-10-16 14:26:18 -07:00
Tim Abbott
7e7113ad84 groups: Enable group-settings value on groups in production.
The main change is redefining ALLOW_GROUP_VALUED_SETTINGS to not
control code, but instead to instead control the configuration for
whether settings that have not been converted to use our modern UI
patterns should require system groups.

Fundamentally, it's the same for the realm/stream group-valued
settings, which don't have the new UI patterns yet.

We remove the visual hiding of the "can manage group" setting, which
was hidden only due to transitions being incomplete.
2024-10-15 15:58:54 -07:00