mirror of
https://github.com/netbirdio/management-integrations.git
synced 2026-05-22 17:09:23 -07:00
Merge pull request #6 from netbirdio/log-only-and-set-approval-to-false
Just log ValidateExtraSettings and set input value to false
This commit is contained in:
@@ -4,12 +4,18 @@ import (
|
||||
"github.com/netbirdio/netbird/management/server/account"
|
||||
"github.com/netbirdio/netbird/management/server/activity"
|
||||
nbpeer "github.com/netbirdio/netbird/management/server/peer"
|
||||
"github.com/netbirdio/netbird/management/server/status"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func ValidateExtraSettings(newExtraSettings *account.ExtraSettings, oldExtraSettings *account.ExtraSettings, peers map[string]*nbpeer.Peer, userID string, accountID string, eventStore activity.Store) error {
|
||||
if newExtraSettings != nil {
|
||||
return status.Errorf(status.InvalidArgument, "extra settings are only supported on the cloud version of NetBird")
|
||||
if oldExtraSettings == nil {
|
||||
log.Info("extra settings are only supported on the cloud version of NetBird")
|
||||
}
|
||||
if newExtraSettings.PeerApprovalEnabled {
|
||||
log.Info("setting peer approval to false")
|
||||
newExtraSettings.PeerApprovalEnabled = false
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user