initial commit
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from govoplan_core.core.access import CAPABILITY_AUTH_PERMISSION_EVALUATOR, CAPABILITY_AUTH_PRINCIPAL_RESOLVER
|
||||
from govoplan_core.core.modules import DocumentationTopic, ModuleInterfaceProvider, ModuleManifest, PermissionDefinition, RoleTemplate
|
||||
|
||||
MODULE_ID = "dist_lists"
|
||||
MODULE_NAME = "Distribution Lists"
|
||||
MODULE_VERSION = "0.1.8"
|
||||
|
||||
READ_SCOPE = "dist_lists:list:read"
|
||||
WRITE_SCOPE = "dist_lists:list:write"
|
||||
ADMIN_SCOPE = "dist_lists:list:admin"
|
||||
|
||||
|
||||
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, "View distribution lists", "Read operational distribution lists and expansion previews."),
|
||||
_permission(WRITE_SCOPE, "Manage distribution lists", "Create and edit operational distribution lists."),
|
||||
_permission(ADMIN_SCOPE, "Administer distribution lists", "Configure distribution-list policies and provider integrations."),
|
||||
)
|
||||
|
||||
ROLE_TEMPLATES = (
|
||||
RoleTemplate(
|
||||
slug="distribution_list_manager",
|
||||
name="Distribution list manager",
|
||||
description="Create, manage, preview, and reuse operational distribution lists.",
|
||||
permissions=(READ_SCOPE, WRITE_SCOPE),
|
||||
),
|
||||
)
|
||||
|
||||
DOCUMENTATION = (
|
||||
DocumentationTopic(
|
||||
id="dist-lists.boundary",
|
||||
title="Distribution list boundary",
|
||||
summary="Distribution lists model operational Verteiler separately from address-book lists and workflow Umlauf execution.",
|
||||
body=(
|
||||
"Distribution Lists owns reusable mixed recipient definitions and expansion snapshots. "
|
||||
"Address lists remain in the addresses module and represent address-domain groupings only. "
|
||||
"Workflow and Tasks own Umlauf execution state, ordering, deadlines, escalation, and completion."
|
||||
),
|
||||
layer="available",
|
||||
documentation_types=("admin", "user"),
|
||||
audience=("operator", "module_admin", "product_owner"),
|
||||
related_modules=("addresses", "campaigns", "mail", "postbox", "notifications", "scheduling", "poll", "workflow", "tasks"),
|
||||
metadata={"seed": True},
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
manifest = ModuleManifest(
|
||||
id=MODULE_ID,
|
||||
name=MODULE_NAME,
|
||||
version=MODULE_VERSION,
|
||||
dependencies=(),
|
||||
optional_dependencies=(
|
||||
"addresses",
|
||||
"access",
|
||||
"identity",
|
||||
"organizations",
|
||||
"campaigns",
|
||||
"mail",
|
||||
"postbox",
|
||||
"notifications",
|
||||
"scheduling",
|
||||
"poll",
|
||||
"workflow",
|
||||
"tasks",
|
||||
),
|
||||
optional_capabilities=(CAPABILITY_AUTH_PRINCIPAL_RESOLVER, CAPABILITY_AUTH_PERMISSION_EVALUATOR),
|
||||
provides_interfaces=(
|
||||
ModuleInterfaceProvider(name="distLists.source", version=MODULE_VERSION),
|
||||
ModuleInterfaceProvider(name="distLists.expand", version=MODULE_VERSION),
|
||||
ModuleInterfaceProvider(name="distLists.writer", version=MODULE_VERSION),
|
||||
),
|
||||
permissions=PERMISSIONS,
|
||||
role_templates=ROLE_TEMPLATES,
|
||||
documentation=DOCUMENTATION,
|
||||
)
|
||||
|
||||
|
||||
def get_manifest() -> ModuleManifest:
|
||||
return manifest
|
||||
Reference in New Issue
Block a user