feat(policy): resolve datasource visibility overlays
Module Package Release / publish-packages (push) Successful in 12s
Module Package Release / publish-packages (push) Successful in 12s
This commit is contained in:
@@ -11,7 +11,13 @@ from govoplan_policy.backend.db.models import PolicyOverride
|
||||
|
||||
POLICY_SCOPE_TYPES = frozenset({"system", "tenant", "group", "user", "campaign"})
|
||||
POLICY_FAMILIES = frozenset(
|
||||
{"campaign_archive_encryption", "definition", "distribution_channels", "view"}
|
||||
{
|
||||
"campaign_archive_encryption",
|
||||
"datasource_visibility",
|
||||
"definition",
|
||||
"distribution_channels",
|
||||
"view",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -24,7 +30,7 @@ def normalize_policy_target(policy_family: str, target_key: str) -> tuple[str, s
|
||||
target = target_key.strip().casefold()
|
||||
if family not in POLICY_FAMILIES:
|
||||
raise PolicyOverrideError(
|
||||
"Policy family must be campaign_archive_encryption, definition, distribution_channels, or view"
|
||||
"Policy family must be campaign_archive_encryption, datasource_visibility, definition, distribution_channels, or view"
|
||||
)
|
||||
if not target or len(target) > 120:
|
||||
raise PolicyOverrideError("Policy target must contain 1 to 120 characters")
|
||||
|
||||
Reference in New Issue
Block a user