mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-23 23:29:15 +01:00
Allow empty groups for DNS setting (#656)
We should allow passing empty group slice for DisabledManagementGroups to reset any setting. Fix DNS settings activities message
This commit is contained in:
parent
dcf6533ed5
commit
793e4f1f29
@ -97,9 +97,9 @@ const (
|
||||
// GroupRemovedFromSetupKeyMessage is a human-readable text message of the GroupRemovedFromSetupKey activity
|
||||
GroupRemovedFromSetupKeyMessage string = "Group removed from user setup key"
|
||||
// GroupAddedToDisabledManagementGroupsMessage is a human-readable text message of the GroupAddedToDisabledManagementGroups activity
|
||||
GroupAddedToDisabledManagementGroupsMessage
|
||||
GroupAddedToDisabledManagementGroupsMessage string = "Group added to disabled management DNS setting"
|
||||
// GroupRemovedFromDisabledManagementGroupsMessage is a human-readable text message of the GroupRemovedFromDisabledManagementGroups activity
|
||||
GroupRemovedFromDisabledManagementGroupsMessage
|
||||
GroupRemovedFromDisabledManagementGroupsMessage string = "Group removed from disabled management DNS setting"
|
||||
)
|
||||
|
||||
// Activity that triggered an Event
|
||||
|
@ -87,9 +87,11 @@ func (am *DefaultAccountManager) SaveDNSSettings(accountID string, userID string
|
||||
return status.Errorf(status.InvalidArgument, "the dns settings provided are nil")
|
||||
}
|
||||
|
||||
err = validateGroups(dnsSettingsToSave.DisabledManagementGroups, account.Groups)
|
||||
if err != nil {
|
||||
return err
|
||||
if len(dnsSettingsToSave.DisabledManagementGroups) != 0 {
|
||||
err = validateGroups(dnsSettingsToSave.DisabledManagementGroups, account.Groups)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
oldSettings := &DNSSettings{}
|
||||
|
Loading…
Reference in New Issue
Block a user