mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	message: Use set instead of list when checking DM permission.
When checking DM permissions, instead of using list of users, we now use set of users to check if any user is in direct_message_permission_group because there can be case when sender can also be one of the recipients.
This commit is contained in:
		@@ -1242,7 +1242,7 @@ def check_user_has_permission_by_role(
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def check_any_user_has_permission_by_role(
 | 
			
		||||
    users: list[UserProfile], setting_group_id: int, system_groups_name_dict: dict[int, str]
 | 
			
		||||
    users: set[UserProfile], setting_group_id: int, system_groups_name_dict: dict[int, str]
 | 
			
		||||
) -> bool:
 | 
			
		||||
    for user in users:
 | 
			
		||||
        if check_user_has_permission_by_role(user, setting_group_id, system_groups_name_dict):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user