feat(N4): Restliche Module — Tasks/Kommunikation/Wiki/Reports/Agents/Tags/Search + Navigation + Dashboard-Schnittstelle (#368)
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
- Scope-Deklarationen: tasks only_mine, kommunikation conversation_ids, wiki category_ids (NEUE contracts.py), report_generator template_ids, automation agent_ids (module_key agents), tags tag_ids, unified_search entity_types dynamisch aus Provider-Registry - Core-Beiträge: navigation default_route (Startseite) + dashboard widget_app_ids (Widget-TYP-Angebot, Layout bleibt Phase M) - Backend-Filter (additive UND): /tasks (only_mine), /comm/conversations, /wiki/articles+/categories (Subtree), /reports/print-templates, /agents, /tags, /search GET+POST (entity_types-Schnitt), /miniapps?host=dashboard - apply_entity_type_scope-Helper (requested ∧ scope) - Frontend: WorkspaceSwitcher default_route-Navigation, Sidebar workspace-menu_order-Sortierung, workspaceStore moduleMenuOrder() - Tests: 18/18 Deklarationen + 11/11 Filter (TDD), Frontend 2/2 + Store 18/18, tsc clean, Build OK - Regression 64 passed (4 Kombi-Failures = Suite-Isolation, solo-bewiesen); Checker 0; Ruff = Vorbestand (Stash-bewiesen)
This commit is contained in:
@@ -105,6 +105,33 @@ class KommunikationContract:
|
||||
}
|
||||
|
||||
|
||||
|
||||
# ─── Workspace Scopes contribution (Phase N4) ───
|
||||
|
||||
@staticmethod
|
||||
def workspace_scopes() -> list[dict]:
|
||||
"""Scope-Dimensionen des communication-Moduls: Räume-Teilmengen (N4)."""
|
||||
return [
|
||||
{
|
||||
"module_key": "communication",
|
||||
"dimensions": [
|
||||
{
|
||||
"key": "conversation_ids",
|
||||
"label": "Räume",
|
||||
"control": "multiselect",
|
||||
"options": [],
|
||||
"value_source": {
|
||||
"endpoint": "/api/v1/comm/conversations",
|
||||
"items_path": "items",
|
||||
"value_key": "id",
|
||||
"label_key": "title",
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
# ─── self-registration ───
|
||||
|
||||
_contract = KommunikationContract()
|
||||
|
||||
@@ -19,7 +19,7 @@ from fastapi import (
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.core.db import get_db
|
||||
from app.deps import get_current_user, require_permission
|
||||
from app.deps import get_current_user, require_permission, require_workspace_scope
|
||||
from app.plugins.builtins.kommunikation.content_types import list_block_types
|
||||
from app.plugins.builtins.kommunikation.dms_bridge import DmsBridge
|
||||
from app.plugins.builtins.kommunikation.rbac import CommRBAC
|
||||
@@ -74,11 +74,23 @@ async def list_user_conversations(
|
||||
archived: bool = Query(False, description="Include archived conversations"),
|
||||
current_user: dict = Depends(get_current_user),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
workspace_scope: dict | None = Depends(require_workspace_scope("communication")),
|
||||
):
|
||||
"""List all conversations for the current user."""
|
||||
"""List all conversations for the current user.
|
||||
|
||||
Phase N4: an active workspace scope (X-Workspace-ID) restricts the list
|
||||
to the configured conversation subset (pure AND — never a grant).
|
||||
"""
|
||||
tenant_id = uuid.UUID(current_user["tenant_id"])
|
||||
user_id = uuid.UUID(current_user["user_id"])
|
||||
convs = await list_conversations(db, tenant_id, user_id, include_archived=archived)
|
||||
# Phase N4: conversation_ids scope — keep only scoped rooms
|
||||
if workspace_scope:
|
||||
from app.services.workspace_scope_service import scope_uuid_set
|
||||
|
||||
conv_scope = scope_uuid_set(workspace_scope.get("conversation_ids"))
|
||||
if conv_scope is not None:
|
||||
convs = [c for c in convs if uuid.UUID(c["id"]) in conv_scope]
|
||||
return {"items": convs, "total": len(convs)}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user