Integrate policy-aware item scopes

This commit is contained in:
2026-10-23 18:55:03 +00:00
parent d03e56398b
commit dfeaf90320
7 changed files with 353 additions and 30 deletions

View File

@@ -316,13 +316,14 @@ func resolveStrictCollectionPolicies(
}
identityFieldsByPath := make(map[string][]string)
collectionPolicies := cloneCollectionPolicyScope(lower)
effectiveLower := cloneCollectionPolicyScope(lower)
collectionPolicies := cloneCollectionPolicyScope(effectiveLower)
var diagnostics []Diagnostic
for _, path := range paths {
key := path.String()
currentDeclarations := declarationsByPath[key]
lowerEntry, hasLower := lower.collections[key]
lowerEntry, hasLower := effectiveLower.collections[key]
var lowerPolicy *collectionPolicy
if hasLower {
copy := cloneCollectionPolicy(lowerEntry.policy)
@@ -346,6 +347,10 @@ func resolveStrictCollectionPolicies(
lowerPolicy.identityFields = nil
lowerPolicy.identityPresent = false
lowerPolicy.identityLocation = nil
lowerPolicy.recordOrder = nil
lowerPolicy.recordPolicies = nil
effectiveLower.retireCollectionPoliciesAtOrBelow(path)
collectionPolicies.retireCollectionPoliciesAtOrBelow(path)
}
resolution, found := resolveCollectionPolicy(path, currentDeclarations, applicationIdentity, lowerPolicy)