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.

stream: Rename `can_subscribe_others_to_all_streams`.

Shubham Padiae912ada51e35
diff --git a/web/src/settings_data.ts b/web/src/settings_data.ts
index ad18d5493b7..427563de7df 100644
--- a/web/src/settings_data.ts
+++ b/web/src/settings_data.ts
@@ -90,7 +90,7 @@ export function user_can_create_multiuse_invite(): boolean {
);
}
-export function can_subscribe_others_to_all_streams(): boolean {
+export function can_subscribe_others_to_all_accessible_streams(): boolean {
return user_has_permission_for_group_setting(
realm.realm_can_add_subscribers_group,
"can_add_subscribers_group",
diff --git a/web/src/stream_data.ts b/web/src/stream_data.ts
index 6c27f9b3898..869da0b7571 100644
--- a/web/src/stream_data.ts
+++ b/web/src/stream_data.ts
@@ -546,7 +546,7 @@ export function can_subscribe_others(sub: StreamSubscription): boolean {
return false;
}
- if (settings_data.can_subscribe_others_to_all_streams()) {
+ if (settings_data.can_subscribe_others_to_all_accessible_streams()) {
return true;
}
diff --git a/web/src/stream_ui_updates.ts b/web/src/stream_ui_updates.ts
index 7a3a9b9578e..ac8ab1d75a4 100644
--- a/web/src/stream_ui_updates.ts
+++ b/web/src/stream_ui_updates.ts
@@ -434,7 +434,7 @@ export function update_add_subscriptions_elements(sub: SettingsSubscription): vo
if (!allow_user_to_add_subs) {
let tooltip_message;
- if (!settings_data.can_subscribe_others_to_all_streams()) {
+ if (!settings_data.can_subscribe_others_to_all_accessible_streams()) {
tooltip_message = $t({
defaultMessage:
"You do not have permission to add other users to channels in this organization.",
diff --git a/web/tests/settings_data.test.cjs b/web/tests/settings_data.test.cjs
index f4803356564..79e36934f91 100644
--- a/web/tests/settings_data.test.cjs
+++ b/web/tests/settings_data.test.cjs
@@ -183,7 +183,7 @@ test_realm_group_settings(
test_realm_group_settings(
"realm_can_add_subscribers_group",
- settings_data.can_subscribe_others_to_all_streams,
+ settings_data.can_subscribe_others_to_all_accessible_streams,
);
test_realm_group_settings(
diff --git a/zerver/lib/streams.py b/zerver/lib/streams.py
index 179642562bf..9e3ee062bc8 100644
--- a/zerver/lib/streams.py
+++ b/zerver/lib/streams.py
@@ -789,7 +789,7 @@ def get_streams_to_which_user_cannot_add_subscribers(
# does not waste database queries re-checking that.
result: list[Stream] = []
- if user_profile.can_subscribe_others_to_all_streams():
+ if user_profile.can_subscribe_others_to_all_accessible_streams():
return []
# Optimization for the organization administrator code path. We
diff --git a/zerver/models/users.py b/zerver/models/users.py
index df7a5e88641..83bc572e5dc 100644
--- a/zerver/models/users.py
+++ b/zerver/models/users.py
@@ -844,7 +844,7 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings):
def can_manage_default_streams(self) -> bool:
return self.is_realm_admin
- def can_subscribe_others_to_all_streams(self) -> bool:
+ def can_subscribe_others_to_all_accessible_streams(self) -> bool:
return self.has_permission("can_add_subscribers_group")
def can_invite_users_by_email(self, realm: Optional["Realm"] = None) -> bool: