File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
services/web/server/src/simcore_service_webserver Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 55import sqlalchemy as sa
66from aiohttp import web
77from common_library .groups_enums import GroupType
8+ from common_library .users_enums import UserRole
89from models_library .basic_types import IDStr
910from models_library .groups import (
1011 AccessRightsDict ,
@@ -499,11 +500,14 @@ async def list_users_in_group(
499500 .select_from (
500501 groups .join (
501502 user_to_groups , user_to_groups .c .gid == groups .c .gid , isouter = True
502- )
503+ ). join ( users , users . c . id == user_to_groups . c . uid )
503504 )
504505 .where (
505506 ((user_to_groups .c .uid == user_id ) & (user_to_groups .c .gid == group_id ))
506- | (groups .c .type == GroupType .PRIMARY ) # TODO: at least active users!
507+ | (
508+ (groups .c .type == GroupType .PRIMARY )
509+ & users .c .role .in_ ([r for r in UserRole if r > UserRole .GUEST ])
510+ )
507511 )
508512 )
509513 group_row = result .first ()
Original file line number Diff line number Diff line change @@ -169,12 +169,12 @@ async def get_user_or_raise(
169169 assert set (return_column_names ).issubset (users .columns .keys ()) # nosec
170170
171171 async with pass_or_acquire_connection (engine , connection ) as conn :
172- result = await conn .stream (
172+ result = await conn .execute (
173173 sa .select (* (users .columns [name ] for name in return_column_names )).where (
174174 users .c .id == user_id
175175 )
176176 )
177- row = await result .first ()
177+ row = result .first ()
178178 if row is None :
179179 raise UserNotFoundError (uid = user_id )
180180 user : dict [str , Any ] = row ._asdict ()
You can’t perform that action at this time.
0 commit comments