mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
user_groups: Do not allow editing system user groups from API.
We do not allow any user to edit the system user groups (including renaming, deleting, adding or removing members, etc.) from the API. These user groups will change only by the code when a new user is added or role of a user is changed. This is implemented by rejecting access_user_group_by_id always except the case when it is use to get the user group for sending email and push notifications, as we would need to send notifications to the mentioned user group.
This commit is contained in:
@@ -937,7 +937,9 @@ def handle_push_notification(user_profile_id: int, missed_message: Dict[str, Any
|
||||
mentioned_user_group_id = missed_message.get("mentioned_user_group_id")
|
||||
|
||||
if mentioned_user_group_id is not None:
|
||||
user_group = access_user_group_by_id(mentioned_user_group_id, user_profile)
|
||||
user_group = access_user_group_by_id(
|
||||
mentioned_user_group_id, user_profile, for_mention=True
|
||||
)
|
||||
mentioned_user_group_name = user_group.name
|
||||
|
||||
apns_payload = get_message_payload_apns(
|
||||
|
||||
Reference in New Issue
Block a user