80 lines
2.7 KiB
Python
80 lines
2.7 KiB
Python
from __future__ import annotations
|
|
|
|
from govoplan_core.core.access import CAPABILITY_AUTH_PERMISSION_EVALUATOR, CAPABILITY_AUTH_PRINCIPAL_RESOLVER
|
|
from govoplan_core.core.policy import (
|
|
CAPABILITY_POLICY_DEFINITION_GOVERNANCE,
|
|
CAPABILITY_POLICY_PRIVACY_RETENTION,
|
|
CAPABILITY_POLICY_SCHEDULING_PARTICIPANT_PRIVACY,
|
|
)
|
|
from govoplan_core.core.modules import (
|
|
FrontendModule,
|
|
ModuleContext,
|
|
ModuleInterfaceProvider,
|
|
ModuleManifest,
|
|
)
|
|
from govoplan_core.core.views import ViewSurface
|
|
|
|
|
|
def _route_factory(context: ModuleContext):
|
|
del context
|
|
from govoplan_policy.backend.api.v1.routes import router
|
|
|
|
return router
|
|
|
|
|
|
def _privacy_retention_service(context: ModuleContext) -> object:
|
|
del context
|
|
from govoplan_policy.backend.retention import SqlPrivacyRetentionService
|
|
|
|
return SqlPrivacyRetentionService()
|
|
|
|
|
|
def _scheduling_participant_privacy_policy(context: ModuleContext) -> object:
|
|
del context
|
|
from govoplan_policy.backend.scheduling_privacy import SqlSchedulingParticipantPrivacyPolicy
|
|
|
|
return SqlSchedulingParticipantPrivacyPolicy()
|
|
|
|
|
|
def _definition_governance_policy(context: ModuleContext) -> object:
|
|
del context
|
|
from govoplan_policy.backend.definition_governance import (
|
|
DefinitionGovernancePolicyProvider,
|
|
)
|
|
|
|
return DefinitionGovernancePolicyProvider()
|
|
|
|
|
|
manifest = ModuleManifest(
|
|
id="policy",
|
|
name="Policy",
|
|
version="0.1.9",
|
|
required_capabilities=(CAPABILITY_AUTH_PRINCIPAL_RESOLVER, CAPABILITY_AUTH_PERMISSION_EVALUATOR),
|
|
provides_interfaces=(
|
|
ModuleInterfaceProvider(
|
|
name="policy.definition_governance",
|
|
version="0.1.0",
|
|
),
|
|
),
|
|
route_factory=_route_factory,
|
|
frontend=FrontendModule(
|
|
module_id="policy",
|
|
package_name="@govoplan/policy-webui",
|
|
view_surfaces=(
|
|
ViewSurface(id="policy.admin.system-retention", module_id="policy", kind="section", label="System retention", order=80),
|
|
ViewSurface(id="policy.admin.tenant-retention", module_id="policy", kind="section", label="Tenant retention", order=80),
|
|
ViewSurface(id="policy.admin.group-retention", module_id="policy", kind="section", label="Group retention", order=80),
|
|
ViewSurface(id="policy.admin.user-retention", module_id="policy", kind="section", label="User retention", order=80),
|
|
),
|
|
),
|
|
capability_factories={
|
|
CAPABILITY_POLICY_DEFINITION_GOVERNANCE: _definition_governance_policy,
|
|
CAPABILITY_POLICY_PRIVACY_RETENTION: _privacy_retention_service,
|
|
CAPABILITY_POLICY_SCHEDULING_PARTICIPANT_PRIVACY: _scheduling_participant_privacy_policy,
|
|
},
|
|
)
|
|
|
|
|
|
def get_manifest() -> ModuleManifest:
|
|
return manifest
|