streams: Allow admins to unsubscribe others irrespective of setting.

This commit is contained in:
Sahil Batra
2024-11-21 14:54:24 +05:30
committed by Tim Abbott
parent 02049fbbf3
commit d1e76a9281
5 changed files with 51 additions and 14 deletions

View File

@@ -675,6 +675,9 @@ def can_remove_subscribers_from_stream(
if not check_basic_stream_access(user_profile, stream, sub, allow_realm_admin=True):
return False
if user_profile.is_realm_admin:
return True
group_allowed_to_remove_subscribers = stream.can_remove_subscribers_group
assert group_allowed_to_remove_subscribers is not None
return user_has_permission_for_group_setting(