Add support to enable/disable the network rating system

This commit is contained in:
Patrick Pacher
2021-12-27 08:41:58 +01:00
parent ca4bac3b1b
commit 165ce53149
7 changed files with 169 additions and 340 deletions

View File

@@ -54,6 +54,12 @@ func setSelectedSecurityLevel(r record.Record) (record.Record, error) {
}
}
// if the network rating system is not used at all we always force the security
// level to trusted.
if !NetworkRatingEnabled() {
upd.SelectedSecurityLevel = SecurityLevelNormal
}
if !IsValidSecurityLevel(upd.SelectedSecurityLevel) {
return nil, fmt.Errorf("invalid security level: %d", upd.SelectedSecurityLevel)
}