156 lines
4.8 KiB
Python
156 lines
4.8 KiB
Python
from __future__ import annotations
|
|
|
|
from govoplan_core.core.access import (
|
|
CAPABILITY_AUTH_PERMISSION_EVALUATOR,
|
|
CAPABILITY_AUTH_PRINCIPAL_RESOLVER,
|
|
)
|
|
from govoplan_core.core.modules import (
|
|
DocumentationLink,
|
|
DocumentationTopic,
|
|
ModuleManifest,
|
|
PermissionDefinition,
|
|
RoleTemplate,
|
|
)
|
|
from govoplan_core.core.provider_governance import declared_module_architecture
|
|
|
|
|
|
MODULE_ID = "wiki"
|
|
MODULE_NAME = "Wiki"
|
|
MODULE_VERSION = "0.1.19"
|
|
READ_SCOPE = "wiki:page:read"
|
|
WRITE_SCOPE = "wiki:page:write"
|
|
ADMIN_SCOPE = "wiki:space:admin"
|
|
OPTIONAL_DEPENDENCIES = (
|
|
"files",
|
|
"dms",
|
|
"records",
|
|
"search",
|
|
"workflow_engine",
|
|
"tasks",
|
|
"projects",
|
|
"cases",
|
|
"templates",
|
|
"notifications",
|
|
)
|
|
|
|
|
|
def _permission(
|
|
scope: str,
|
|
label: str,
|
|
description: str,
|
|
) -> PermissionDefinition:
|
|
module_id, resource, action = scope.split(":", 2)
|
|
return PermissionDefinition(
|
|
scope=scope,
|
|
label=label,
|
|
description=description,
|
|
category=MODULE_NAME,
|
|
level="tenant",
|
|
module_id=module_id,
|
|
resource=resource,
|
|
action=action,
|
|
)
|
|
|
|
|
|
PERMISSIONS = (
|
|
_permission(READ_SCOPE, "Read Wiki pages", "Discover and read accessible Wiki pages."),
|
|
_permission(WRITE_SCOPE, "Edit Wiki pages", "Create and revise pages in writable spaces."),
|
|
_permission(ADMIN_SCOPE, "Administer Wiki spaces", "Configure spaces, publishing, and access."),
|
|
)
|
|
|
|
ROLE_TEMPLATES = (
|
|
RoleTemplate(
|
|
slug="wiki_editor",
|
|
name="Wiki editor",
|
|
description="Read and revise Wiki pages.",
|
|
permissions=(READ_SCOPE, WRITE_SCOPE),
|
|
),
|
|
RoleTemplate(
|
|
slug="wiki_reader",
|
|
name="Wiki reader",
|
|
description="Read accessible Wiki pages.",
|
|
permissions=(READ_SCOPE,),
|
|
),
|
|
)
|
|
|
|
DOCUMENTATION = (
|
|
DocumentationTopic(
|
|
id="wiki.module-boundary",
|
|
title="Wiki module boundary",
|
|
summary=(
|
|
"Collaborative knowledge spaces, pages, revisions, links, labels, "
|
|
"access, and publishing."
|
|
),
|
|
body=(
|
|
"Wiki owns revisioned knowledge pages. Files/DMS owns binary "
|
|
"attachments, Records owns formal retention, and connectors own "
|
|
"MediaWiki/BlueSpice synchronization."
|
|
),
|
|
layer="available",
|
|
documentation_types=("admin", "user"),
|
|
audience=("user", "operator", "module_admin", "product_owner"),
|
|
translations={
|
|
"de": {
|
|
"title": "Modulgrenze von Wiki",
|
|
"summary": "Gemeinsam bearbeitete Wissensbereiche, Seiten, Revisionen, Verknüpfungen, Schlagwörter, Zugriff und Veröffentlichung.",
|
|
"body": "Wiki verwaltet versionierte Wissensseiten. Files beziehungsweise DMS verwaltet binäre Anhänge, Records die formale Aufbewahrung und Connectors die Synchronisierung mit MediaWiki oder BlueSpice.",
|
|
}
|
|
},
|
|
related_modules=OPTIONAL_DEPENDENCIES,
|
|
links=(
|
|
DocumentationLink(
|
|
label="Repository domain boundary",
|
|
href="govoplan-wiki/docs/WIKI_DOMAIN_BOUNDARY.md",
|
|
kind="repository",
|
|
),
|
|
),
|
|
metadata={
|
|
"kind": "reference",
|
|
"seed": True,
|
|
"consequence_classes": {
|
|
"seed_boundary": "Declares ownership and permissions only; no runtime workflow is available yet.",
|
|
},
|
|
"domain_objects": [
|
|
"wiki space",
|
|
"wiki page",
|
|
"page revision",
|
|
"page link",
|
|
"page label",
|
|
"publishing state",
|
|
],
|
|
"first_slice": (
|
|
"Implement spaces, revisioned pages, links, access checks, "
|
|
"and permission-aware search publication."
|
|
),
|
|
},
|
|
),
|
|
)
|
|
|
|
manifest = ModuleManifest(
|
|
id=MODULE_ID,
|
|
name=MODULE_NAME,
|
|
version=MODULE_VERSION,
|
|
dependencies=("access",),
|
|
optional_dependencies=OPTIONAL_DEPENDENCIES,
|
|
required_capabilities=(
|
|
CAPABILITY_AUTH_PRINCIPAL_RESOLVER,
|
|
CAPABILITY_AUTH_PERMISSION_EVALUATOR,
|
|
),
|
|
permissions=PERMISSIONS,
|
|
role_templates=ROLE_TEMPLATES,
|
|
documentation=DOCUMENTATION,
|
|
architecture=declared_module_architecture(
|
|
layer="content_records_evidence",
|
|
kind="domain",
|
|
maturity="scaffold",
|
|
documentation_ref="docs/WIKI_DOMAIN_BOUNDARY.md",
|
|
known_limits=("Wiki spaces, pages, revisions, publishing, and search projection are not implemented yet.",),
|
|
owned_concepts=("wiki space", "wiki page", "page revision", "page link"),
|
|
non_owned_concepts=("binary attachment", "record disposition", "external MediaWiki page"),
|
|
),
|
|
)
|
|
|
|
|
|
def get_manifest() -> ModuleManifest:
|
|
return manifest
|