Enforce tenant module entitlements beyond requests
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from govoplan_core.core.module_entitlements import (
|
||||
TenantModuleAdmission,
|
||||
TenantWorkState,
|
||||
)
|
||||
|
||||
|
||||
def allowed_worker_admissions(
|
||||
_registry,
|
||||
_session,
|
||||
*,
|
||||
capability_name: str,
|
||||
tenant_id: str | None,
|
||||
work_state: TenantWorkState = "accepted",
|
||||
) -> tuple[TenantModuleAdmission, ...]:
|
||||
return (
|
||||
TenantModuleAdmission(
|
||||
tenant_id=tenant_id or "tenant-1",
|
||||
module_id=capability_name.split(".", 1)[0],
|
||||
revision=1,
|
||||
work_state=work_state,
|
||||
allowed=True,
|
||||
disposition="allowed",
|
||||
reason="Test tenant permits the worker capability.",
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user