1212import datetime
1313import logging
1414from collections import defaultdict
15- from collections .abc import Generator , Iterable
15+ from collections .abc import Iterable
1616from contextlib import suppress
1717from decimal import Decimal
1818from pprint import pformat
130130from ..workspaces import _workspaces_repository as workspaces_workspaces_repository
131131from . import (
132132 _crud_api_delete ,
133+ _groups_service ,
133134 _nodes_service ,
134135 _projects_nodes_repository ,
135136 _projects_repository ,
@@ -2107,9 +2108,13 @@ async def notify_project_state_update(
21072108 message = message ,
21082109 )
21092110 else :
2110- rooms_to_notify : Generator [ GroupID , None , None ] = (
2111- gid for gid , rights in project ["accessRights" ]. items () if rights [ "read " ]
2111+ project_group_get_list = await _groups_service . list_project_groups_by_project_without_checking_permissions (
2112+ app , project_id = project ["uuid " ]
21122113 )
2114+
2115+ rooms_to_notify = [
2116+ item .gid for item in project_group_get_list if item .read is True
2117+ ]
21132118 for room in rooms_to_notify :
21142119 await send_message_to_standard_group (app , group_id = room , message = message )
21152120
@@ -2123,9 +2128,10 @@ async def notify_project_node_update(
21232128 if await is_project_hidden (app , ProjectID (project ["uuid" ])):
21242129 return
21252130
2126- rooms_to_notify : list [GroupID ] = [
2127- gid for gid , rights in project ["accessRights" ].items () if rights ["read" ]
2128- ]
2131+ project_group_get_list = await _groups_service .list_project_groups_by_project_without_checking_permissions (
2132+ app , project_id = project ["uuid" ]
2133+ )
2134+ rooms_to_notify = [item .gid for item in project_group_get_list if item .read is True ]
21292135
21302136 message = SocketMessageDict (
21312137 event_type = SOCKET_IO_NODE_UPDATED_EVENT ,
0 commit comments