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
This commit is contained in:
Shubham Padia
2025-01-14 07:36:48 +00:00
committed by Tim Abbott
parent 9402b248a1
commit 275a1a4c69
12 changed files with 96 additions and 227 deletions

View File

@@ -4780,11 +4780,6 @@ paths:
type: boolean
description: |
Whether an invitation is required to join this organization.
invite_to_stream_policy:
type: integer
description: |
The [policy](/api/roles-and-permissions#permission-levels)
for which users can add other users to channels in this organization.
jitsi_server_url:
type: string
nullable: true
@@ -16843,13 +16838,6 @@ paths:
**Changes**: Added in Zulip 5.0 (feature level 103).
[permission-level]: /api/roles-and-permissions#permission-levels
realm_invite_to_stream_policy:
type: integer
description: |
Present if `realm` is present in `fetch_event_types`.
The [policy](/api/roles-and-permissions#permission-levels)
for which users can add other users to channels in this organization.
realm_wildcard_mention_policy:
type: integer
description: |