mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
user_groups: Add access_user_group_to_read_membership.
This commit adds access_user_group_to_read_membership function so that we can avoid calling get_user_group_by_id_in_realm with "for_read=True" from views functions, which is better for security since that function does not do any access checks.
This commit is contained in:
@@ -125,6 +125,10 @@ def get_user_group_by_id_in_realm(
|
||||
raise JsonableError(_("Invalid user group"))
|
||||
|
||||
|
||||
def access_user_group_to_read_membership(user_group_id: int, realm: Realm) -> NamedUserGroup:
|
||||
return get_user_group_by_id_in_realm(user_group_id, realm, for_read=True)
|
||||
|
||||
|
||||
def check_permission_for_managing_all_groups(
|
||||
user_group: UserGroup, user_profile: UserProfile
|
||||
) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user