44# pylint: disable=too-many-arguments
55
66
7- from enum import Enum
87from typing import Annotated
98
10- from _common import as_query
119from fastapi import APIRouter , Depends , status
1210from models_library .api_schemas_webserver .users import (
11+ MyFunctionPermissionsGet ,
1312 MyPermissionGet ,
1413 MyProfileGet ,
1514 MyProfilePatch ,
1615 MyTokenCreate ,
1716 MyTokenGet ,
18- UserAccountApprove ,
19- UserAccountGet ,
20- UserAccountReject ,
21- UserAccountSearchQueryParams ,
2217 UserGet ,
23- UsersAccountListQueryParams ,
2418 UsersSearch ,
2519)
2620from models_library .api_schemas_webserver .users_preferences import PatchRequestBody
2721from models_library .generics import Envelope
28- from models_library .rest_pagination import Page
2922from models_library .user_preferences import PreferenceIdentifier
3023from simcore_service_webserver ._meta import API_VTAG
31- from simcore_service_webserver .users ._common .schemas import PreRegisteredUserGet
3224from simcore_service_webserver .users ._notifications import (
3325 UserNotification ,
3426 UserNotificationCreate ,
@@ -128,6 +120,13 @@ async def mark_notification_as_read(
128120async def list_user_permissions (): ...
129121
130122
123+ @router .get (
124+ "/me/function-permissions" ,
125+ response_model = Envelope [MyFunctionPermissionsGet ],
126+ )
127+ async def list_user_functions_permissions (): ...
128+
129+
131130#
132131# USERS public
133132#
@@ -139,56 +138,3 @@ async def list_user_permissions(): ...
139138 description = "Search among users who are publicly visible to the caller (i.e., me) based on their privacy settings." ,
140139)
141140async def search_users (_body : UsersSearch ): ...
142-
143-
144- #
145- # USERS admin
146- #
147-
148- _extra_tags : list [str | Enum ] = ["admin" ]
149-
150-
151- @router .get (
152- "/admin/user-accounts" ,
153- response_model = Page [UserAccountGet ],
154- tags = _extra_tags ,
155- )
156- async def list_users_accounts (
157- _query : Annotated [as_query (UsersAccountListQueryParams ), Depends ()],
158- ): ...
159-
160-
161- @router .post (
162- "/admin/user-accounts:approve" ,
163- status_code = status .HTTP_204_NO_CONTENT ,
164- tags = _extra_tags ,
165- )
166- async def approve_user_account (_body : UserAccountApprove ): ...
167-
168-
169- @router .post (
170- "/admin/user-accounts:reject" ,
171- status_code = status .HTTP_204_NO_CONTENT ,
172- tags = _extra_tags ,
173- )
174- async def reject_user_account (_body : UserAccountReject ): ...
175-
176-
177- @router .get (
178- "/admin/user-accounts:search" ,
179- response_model = Envelope [list [UserAccountGet ]],
180- tags = _extra_tags ,
181- )
182- async def search_user_accounts (
183- _query : Annotated [UserAccountSearchQueryParams , Depends ()],
184- ):
185- # NOTE: see `Search` in `Common Custom Methods` in https://cloud.google.com/apis/design/custom_methods
186- ...
187-
188-
189- @router .post (
190- "/admin/user-accounts:pre-register" ,
191- response_model = Envelope [UserAccountGet ],
192- tags = _extra_tags ,
193- )
194- async def pre_register_user_account (_body : PreRegisteredUserGet ): ...
0 commit comments