Address PR feedback on render_config permissions
Some checks failed
CI / build (20.x, 3.12) (push) Has been cancelled
CI / build (20.x, 3.13) (push) Has been cancelled

Remove redundant permission checks, add view permission enforcement via
chained restrict() calls, and rename ConfigTemplate permission action
from render_config to render for consistency.
This commit is contained in:
Jason Novinger
2025-10-16 11:09:07 -05:00
parent e57f9beced
commit 9967b20663
6 changed files with 17 additions and 22 deletions

View File

@@ -92,8 +92,8 @@ http://netbox:8000/api/extras/config-templates/123/render/ \
```
!!! note "Permissions"
Rendering configuration templates via the REST API requires the `render_config` permission for the relevant object type:
Rendering configuration templates via the REST API requires appropriate permissions for the relevant object type:
* To render a device's configuration via `/api/dcim/devices/{id}/render-config/`, assign a permission for "DCIM > Device" with the `render_config` action
* To render a virtual machine's configuration via `/api/virtualization/virtual-machines/{id}/render-config/`, assign a permission for "Virtualization > Virtual Machine" with the `render_config` action
* To render a config template directly via `/api/extras/config-templates/{id}/render/`, assign a permission for "Extras > Config Template" with the `render_config` action
* To render a config template directly via `/api/extras/config-templates/{id}/render/`, assign a permission for "Extras > Config Template" with the `render` action