mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
streams: Use can_add_subscribers_group for permission check.
The function to check relevant permissions does so for multiple streams at once to save us database query counts. Doing it one by one for every stream would become very expensive. We've also added `insufficient_permission_streams` to the filter functions return type for streams for which the current user does not have permission to subscribe other users.
This commit is contained in:
committed by
Tim Abbott
parent
7df417f8b1
commit
41c74314c0
@@ -844,7 +844,7 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings):
|
||||
def can_manage_default_streams(self) -> bool:
|
||||
return self.is_realm_admin
|
||||
|
||||
def can_subscribe_other_users(self) -> bool:
|
||||
def can_subscribe_others_to_all_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