operasoftware / dns-ui

Opera's LDAP-authenticated PowerDNS user interface
Apache License 2.0
283 stars 57 forks source link

Option to restrict Classification column to predetermined values #155

Closed uedvt359 closed 5 years ago

uedvt359 commented 5 years ago

As with the previous pull requests, we're happy to implement any changes requested in order to get this merged. Thanks!

This adds a new config variable classification_whitelist (chosen so it matches the UI's naming), which restricts which values can be set in the classification field. Note that this is a front-end change only; it guards against accidental typos, not a predetermined sysadmin wanting to cause trouble ;-)

When editing a zone, there may be a non-whitelisted value already in the field. Then, this value will be temporarily added to just this zone's whitelist, so it can be saved correctly. Once the value gets changed to a whitelisted one, it can't be reverted (through the UI) to a non-whitelisted one. (hope that makes sense)