102 lines
3.6 KiB
Python
102 lines
3.6 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
|
|
|
|
MODULE_ID = "transparency"
|
|
MODULE_NAME = "Transparency"
|
|
MODULE_VERSION = "0.1.6"
|
|
READ_SCOPE = "transparency:workspace:read"
|
|
WRITE_SCOPE = "transparency:workspace:write"
|
|
ADMIN_SCOPE = "transparency:workspace:admin"
|
|
OPTIONAL_DEPENDENCIES = (
|
|
"records",
|
|
"files",
|
|
"dms",
|
|
"portal",
|
|
"audit",
|
|
"policy",
|
|
)
|
|
|
|
|
|
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="Transparency",
|
|
level="tenant",
|
|
module_id=module_id,
|
|
resource=resource,
|
|
action=action,
|
|
)
|
|
|
|
|
|
PERMISSIONS = (
|
|
_permission(READ_SCOPE, "View transparency workspace", "Read transparency records, configuration, and workflow context."),
|
|
_permission(WRITE_SCOPE, "Manage transparency workspace", "Create and update transparency records and workflow state."),
|
|
_permission(ADMIN_SCOPE, "Administer transparency workspace", "Configure transparency policies, templates, and tenant-level administration."),
|
|
)
|
|
|
|
ROLE_TEMPLATES = (
|
|
RoleTemplate(
|
|
slug="transparency_manager",
|
|
name="Transparency manager",
|
|
description="Manage transparency records and workflow state.",
|
|
permissions=(READ_SCOPE, WRITE_SCOPE),
|
|
),
|
|
RoleTemplate(
|
|
slug="transparency_viewer",
|
|
name="Transparency viewer",
|
|
description="Read transparency records and workflow context.",
|
|
permissions=(READ_SCOPE,),
|
|
),
|
|
)
|
|
|
|
DOCUMENTATION = (
|
|
DocumentationTopic(
|
|
id=f"{MODULE_ID}.module-boundary",
|
|
title=f"{MODULE_NAME} module boundary",
|
|
summary="Transparency and FOI workflows for public-records requests, publication duties, disclosure workflows, redaction, and transparency portals.",
|
|
body=(
|
|
"This repository is currently a platform module seed. It registers the domain boundary, "
|
|
"permission surface, role templates, and documentation metadata before runtime APIs, "
|
|
"database models, migrations, and WebUI routes are introduced."
|
|
),
|
|
layer="available",
|
|
documentation_types=("admin",),
|
|
audience=("operator", "module_admin", "product_owner"),
|
|
order=100,
|
|
related_modules=OPTIONAL_DEPENDENCIES,
|
|
links=(
|
|
DocumentationLink(
|
|
label="Repository domain boundary",
|
|
href="govoplan-transparency/docs/TRANSPARENCY_DOMAIN_BOUNDARY.md",
|
|
kind="repository",
|
|
),
|
|
),
|
|
metadata={
|
|
"seed": True,
|
|
"domain_objects": ['FOI and public-records requests', 'publication duties', 'disclosure workflow state', 'redaction review records', 'transparency portal handoff'],
|
|
"first_slice": "Define transparency request, disclosure review, redaction task, publication duty, and portal publication records.",
|
|
},
|
|
),
|
|
)
|
|
|
|
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,
|
|
)
|
|
|
|
|
|
def get_manifest() -> ModuleManifest:
|
|
return manifest
|