Skip to content

Commit 4d9d1ce

Browse files
refactor listing folders
1 parent ce9d3a5 commit 4d9d1ce

File tree

4 files changed

+485
-379
lines changed

4 files changed

+485
-379
lines changed

packages/postgres-database/src/simcore_postgres_database/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,11 @@ def as_postgres_sql_query_str(statement) -> str:
8181
dialect=postgresql.dialect(), # type: ignore[misc]
8282
)
8383
return f"{compiled}"
84+
85+
86+
def assemble_array_groups(user_group_ids: list[int]) -> str:
87+
return (
88+
"array[]::text[]"
89+
if len(user_group_ids) == 0
90+
else f"""array[{', '.join(f"'{group_id}'" for group_id in user_group_ids)}]"""
91+
)

services/storage/src/simcore_service_storage/db_access_layer.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
workspaces_access_rights,
5252
)
5353
from simcore_postgres_database.storage_models import file_meta_data, user_to_groups
54+
from simcore_postgres_database.utils import assemble_array_groups
5455

5556
logger = logging.getLogger(__name__)
5657

@@ -117,14 +118,6 @@ def _aggregate_access_rights(
117118
return AccessRights.none()
118119

119120

120-
def assemble_array_groups(user_group_ids: list[GroupID]) -> str:
121-
return (
122-
"array[]::text[]"
123-
if len(user_group_ids) == 0
124-
else f"""array[{', '.join(f"'{group_id}'" for group_id in user_group_ids)}]"""
125-
)
126-
127-
128121
access_rights_subquery = (
129122
sa.select(
130123
project_to_groups.c.project_uuid,

0 commit comments

Comments
 (0)