Initial work on #10244: Protection rules (#14097)

This commit is contained in:
Jeremy Stretch
2023-10-30 14:36:56 -04:00
committed by GitHub
parent c4e765c4a8
commit edc4a35296
8 changed files with 183 additions and 13 deletions

View File

@@ -87,3 +87,24 @@ The following colors are supported:
* `gray`
* `black`
* `white`
---
## PROTECTION_RULES
!!! tip "Dynamic Configuration Parameter"
This is a mapping of models to [custom validators](../customization/custom-validation.md) against which an object is evaluated immediately prior to its deletion. If validation fails, the object is not deleted. An example is provided below:
```python
PROTECTION_RULES = {
"dcim.site": [
{
"status": {
"eq": "decommissioning"
}
},
"my_plugin.validators.Validator1",
]
}
```