mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
stream: Rename can_subscribe_others_to_all_streams.
Rename `can_subscribe_others_to_all_streams` to `can_subscribe_others_to_all_accessible_streams` so it's clear that we are not attempting to check basic access in this function.
This commit is contained in:
committed by
Tim Abbott
parent
32f9ee7a62
commit
e912ada51e
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user