Merge branch 'feature/validate-group-association' into feature/validate-group-association-debug

This commit is contained in:
bcmmbaga
2024-10-21 22:36:43 +03:00
8 changed files with 317 additions and 20 deletions

View File

@@ -463,15 +463,14 @@ func (am *DefaultAccountManager) savePolicy(account *Account, policyToSave *Poli
}
oldPolicy := account.Policies[policyIdx]
// Update the existing policy
account.Policies[policyIdx] = policyToSave
if !policyToSave.Enabled && !oldPolicy.Enabled {
return false, nil
}
updateAccountPeers := anyGroupHasPeers(account, oldPolicy.ruleGroups()) || anyGroupHasPeers(account, policyToSave.ruleGroups())
// Update the existing policy
account.Policies[policyIdx] = policyToSave
return updateAccountPeers, nil
}