Skip to content

Commit a9f0f7f

Browse files
committed
@sanderegg review: as_admin functions
1 parent 0688e96 commit a9f0f7f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

services/web/server/src/simcore_service_webserver/users/_users_service.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,14 @@ async def get_user_id_from_gid(app: web.Application, primary_gid: GroupID) -> Us
132132
async def search_users_as_admin(
133133
app: web.Application, email_glob: str, *, include_products: bool = False
134134
) -> list[UserForAdminGet]:
135-
# NOTE: this search is deploy-wide i.e. independent of the product!
135+
"""
136+
WARNING: this information is reserved for admin users. Note that the returned model include UserForAdminGet
137+
138+
NOTE: Functions in the service layer typically validate the caller's access rights
139+
using parameters like product_name and user_id. However, this function skips
140+
such checks as it is designed for scenarios (e.g., background tasks) where
141+
no caller or context is available.
142+
"""
136143

137144
def _glob_to_sql_like(glob_pattern: str) -> str:
138145
# Escape SQL LIKE special characters in the glob pattern

0 commit comments

Comments
 (0)