diff --git a/api/specs/web-server/_groups.py b/api/specs/web-server/_groups.py index 530460c6d8c..6f0f1f1e616 100644 --- a/api/specs/web-server/_groups.py +++ b/api/specs/web-server/_groups.py @@ -4,6 +4,7 @@ # pylint: disable=too-many-arguments +from enum import Enum from typing import Annotated, Any from fastapi import APIRouter, Depends, status @@ -87,19 +88,24 @@ async def delete_group(_path: Annotated[GroupsPathParams, Depends()]): """ +_extra_tags: list[str | Enum] = ["users"] + + @router.get( "/groups/{gid}/users", response_model=Envelope[list[GroupUserGet]], + tags=_extra_tags, ) async def get_all_group_users(_path: Annotated[GroupsPathParams, Depends()]): """ - Gets users in organization groups + Gets users in organization or primary groups """ @router.post( "/groups/{gid}/users", status_code=status.HTTP_204_NO_CONTENT, + tags=_extra_tags, ) async def add_group_user( _path: Annotated[GroupsPathParams, Depends()], @@ -113,6 +119,7 @@ async def add_group_user( @router.get( "/groups/{gid}/users/{uid}", response_model=Envelope[GroupUserGet], + tags=_extra_tags, ) async def get_group_user( _path: Annotated[GroupsUsersPathParams, Depends()], @@ -125,6 +132,7 @@ async def get_group_user( @router.patch( "/groups/{gid}/users/{uid}", response_model=Envelope[GroupUserGet], + tags=_extra_tags, ) async def update_group_user( _path: Annotated[GroupsUsersPathParams, Depends()], @@ -138,6 +146,7 @@ async def update_group_user( @router.delete( "/groups/{gid}/users/{uid}", status_code=status.HTTP_204_NO_CONTENT, + tags=_extra_tags, ) async def delete_group_user( _path: Annotated[GroupsUsersPathParams, Depends()], diff --git a/api/specs/web-server/_users.py b/api/specs/web-server/_users.py index 586c5c3ddc0..af69fb0bdaa 100644 --- a/api/specs/web-server/_users.py +++ b/api/specs/web-server/_users.py @@ -33,7 +33,7 @@ from simcore_service_webserver.users._notifications_rest import _NotificationPathParams from simcore_service_webserver.users._tokens_rest import _TokenPathParams -router = APIRouter(prefix=f"/{API_VTAG}", tags=["user"]) +router = APIRouter(prefix=f"/{API_VTAG}", tags=["users"]) @router.get( diff --git a/services/web/server/src/simcore_service_webserver/users/_users_repository.py b/services/web/server/src/simcore_service_webserver/users/_users_repository.py index 26d6665de78..b18fc13d8f8 100644 --- a/services/web/server/src/simcore_service_webserver/users/_users_repository.py +++ b/services/web/server/src/simcore_service_webserver/users/_users_repository.py @@ -139,6 +139,13 @@ async def search_public_user( _is_public(users.c.privacy_hide_email, caller_id) & users.c.email.ilike(_pattern) ) + | ( + _is_public(users.c.privacy_hide_fullname, caller_id) + & ( + users.c.first_name.ilike(_pattern) + | users.c.last_name.ilike(_pattern) + ) + ) ) .limit(limit) )