mirror of
https://github.com/netbirdio/netbird.git
synced 2025-02-07 14:00:12 +01:00
update account policy check before verifying policy status
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
parent
ea6d037b17
commit
9b0424ea55
@ -461,15 +461,14 @@ func (am *DefaultAccountManager) savePolicy(account *Account, policyToSave *Poli
|
|||||||
}
|
}
|
||||||
|
|
||||||
oldPolicy := account.Policies[policyIdx]
|
oldPolicy := account.Policies[policyIdx]
|
||||||
|
// Update the existing policy
|
||||||
|
account.Policies[policyIdx] = policyToSave
|
||||||
|
|
||||||
if !policyToSave.Enabled && !oldPolicy.Enabled {
|
if !policyToSave.Enabled && !oldPolicy.Enabled {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
updateAccountPeers := anyGroupHasPeers(account, oldPolicy.ruleGroups()) || anyGroupHasPeers(account, policyToSave.ruleGroups())
|
updateAccountPeers := anyGroupHasPeers(account, oldPolicy.ruleGroups()) || anyGroupHasPeers(account, policyToSave.ruleGroups())
|
||||||
|
|
||||||
// Update the existing policy
|
|
||||||
account.Policies[policyIdx] = policyToSave
|
|
||||||
|
|
||||||
return updateAccountPeers, nil
|
return updateAccountPeers, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user