feat(dashboard): add governed DSAR coverage
This commit is contained in:
@@ -8,10 +8,13 @@ from govoplan_core.core.module_guards import (
|
||||
persistent_table_uninstall_guard,
|
||||
)
|
||||
from govoplan_core.core.modules import (
|
||||
CapabilityDocumentation,
|
||||
DocumentationTopic,
|
||||
FrontendModule,
|
||||
FrontendRoute,
|
||||
MigrationSpec,
|
||||
ModuleContext,
|
||||
ModuleInterfaceProvider,
|
||||
ModuleManifest,
|
||||
NavItem,
|
||||
)
|
||||
@@ -19,6 +22,10 @@ from govoplan_core.core.provider_governance import declared_module_architecture
|
||||
from govoplan_core.core.views import ViewSurface
|
||||
from govoplan_core.db.base import Base
|
||||
from govoplan_dashboard.backend.db.models import DashboardLayout
|
||||
from govoplan_dashboard.backend.dsar_provider import (
|
||||
DASHBOARD_DSAR_CAPABILITY,
|
||||
DashboardDsarProvider,
|
||||
)
|
||||
|
||||
|
||||
def _dashboard_router(_context):
|
||||
@@ -27,6 +34,10 @@ def _dashboard_router(_context):
|
||||
return router
|
||||
|
||||
|
||||
def _dsar_provider(_context: ModuleContext) -> DashboardDsarProvider:
|
||||
return DashboardDsarProvider()
|
||||
|
||||
|
||||
def _tenant_summary(session, tenant_id: str) -> dict[str, int]:
|
||||
return {
|
||||
"dashboard_layouts": (
|
||||
@@ -43,7 +54,21 @@ manifest = ModuleManifest(
|
||||
version="0.1.18",
|
||||
required_capabilities=(CAPABILITY_AUTH_PRINCIPAL_RESOLVER, CAPABILITY_AUTH_PERMISSION_EVALUATOR),
|
||||
optional_dependencies=("ops", "campaigns", "files", "mail", "tasks", "notifications", "reporting"),
|
||||
provides_interfaces=(
|
||||
ModuleInterfaceProvider(name=DASHBOARD_DSAR_CAPABILITY, version="0.1.0"),
|
||||
),
|
||||
route_factory=_dashboard_router,
|
||||
capability_factories={DASHBOARD_DSAR_CAPABILITY: _dsar_provider},
|
||||
capability_documentation={
|
||||
DASHBOARD_DSAR_CAPABILITY: CapabilityDocumentation(
|
||||
label="Dashboard data-subject request provider",
|
||||
summary=(
|
||||
"Exports and deletes exact account-owned Dashboard layout "
|
||||
"preferences without traversing widget data."
|
||||
),
|
||||
contract_version="0.1.0",
|
||||
),
|
||||
},
|
||||
tenant_summary_providers=(_tenant_summary,),
|
||||
migration_spec=MigrationSpec(
|
||||
module_id="dashboard",
|
||||
@@ -122,6 +147,45 @@ manifest = ModuleManifest(
|
||||
),
|
||||
),
|
||||
documentation=(
|
||||
DocumentationTopic(
|
||||
id="dashboard.data-subject-requests",
|
||||
title="Dashboard data-subject requests",
|
||||
summary=(
|
||||
"Export or delete personal Dashboard layouts without changing "
|
||||
"the data displayed by their widgets."
|
||||
),
|
||||
body=(
|
||||
"Dashboard contributes layouts only when the request contains one "
|
||||
"exact, corroborated account identifier in the active tenant. A "
|
||||
"layout or View reference can narrow that result. The access package "
|
||||
"contains layout version, revision, View, widget identities, sizes, "
|
||||
"and positions. It deliberately omits arbitrary widget configuration "
|
||||
"values and never follows a widget into its owning module. Erasure "
|
||||
"deletes the selected account-owned layout after verifying its owner "
|
||||
"and revision; a repeated execution is unchanged. The operation does "
|
||||
"not delete widgets, reports, files, tasks, or any other domain data."
|
||||
),
|
||||
layer="configured",
|
||||
documentation_types=("admin", "user"),
|
||||
audience=("user", "tenant_admin", "operator", "auditor"),
|
||||
related_modules=("core", "views"),
|
||||
order=19,
|
||||
metadata={
|
||||
"help_contexts": [
|
||||
"dashboard.page",
|
||||
"dashboard.action.reset",
|
||||
"privacy.data-subject-requests",
|
||||
],
|
||||
"consequence_classes": {
|
||||
"export_layout": (
|
||||
"Returns minimized layout structure, never widget-domain data."
|
||||
),
|
||||
"delete_layout": (
|
||||
"Irreversibly removes the selected personal layout only."
|
||||
),
|
||||
},
|
||||
},
|
||||
),
|
||||
DocumentationTopic(
|
||||
id="dashboard.configurable-home",
|
||||
title="Configurable user dashboard",
|
||||
|
||||
Reference in New Issue
Block a user