fetch_available_workspaces_for_organization(): ist_global-Feld ergänzen

Fürs neue Kunden-Workspace-Creator-UI (Phase 3) - damit die
Kundenplattform zwischen eigenen (bearbeitbar) und globalen
(schreibgeschützt) Workspaces unterscheiden kann.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VLk93dhDMrkPXefVdknMV9
This commit is contained in:
adminandClaude Sonnet 5 committed 2026-09-11 09:02:49 +02:00
1 parent aa9072ef91
commit 965db2b541
1 file changed
+13 -3
+13 -3
View File
@@ -2561,7 +2561,7 @@ def fetch_available_workspaces_for_organization(organization_id: str):
with conn.cursor() as cur:
cur.execute(
"""
SELECT id, key, name, description
SELECT id, key, name, description, organization_id
FROM workspaces
WHERE organization_id IS NULL OR organization_id = %s
ORDER BY (organization_id IS NULL) DESC, name
@@ -2569,8 +2569,18 @@ def fetch_available_workspaces_for_organization(organization_id: str):
(organization_id,),
)
return [
{"id": str(wid), "key": key, "name": name, "description": description}
for wid, key, name, description in cur.fetchall()
{
"id": str(wid),
"key": key,
"name": name,
"description": description,
# GUI-Umbau Phase 3 (11.09.2026, Kunden-Workspace-Creator):
# ist_global steuert, ob der Kunde die Zusammensetzung
# bearbeiten darf (eigener Workspace) oder nur lesend
# sieht (globaler, schreibgeschützter Standard).
"ist_global": ws_org_id is None,
}
for wid, key, name, description, ws_org_id in cur.fetchall()
]
def create_workspace(key: str, name: str, description: str | None, organization_id: str | None):