netbox
netbox copied to clipboard
Server error when creating permission constraints for extras > script
Deployment Type
Self-hosted
NetBox Version
v3.7.2
Python Version
3.10
Steps to Reproduce
- Create Script
from extras.scripts import *
class TestScript(Script):
class Meta:
name = "TestScript"
description = "Just for testing"
def run(self, data, commit):
return "Test"
API-View:
- Go to
/users/permissions/add/and create a viewing permission forExtras > Scriptwith the following constraint. Keep in mindChoices are: idonly - We are creating two seperate errors so two constraints needed
- First:
{"id": "test.TestScript"}-> Got id from/api/extras/scripts/test.TestScript/ - Second: {"id": 1} -> Just a number, because first error said a number is expected
- First:
The goal was to create a permission for a group to see only a selected script.
Expected Behavior
One of the constraints should work and create a permission to see the selected script.
Observed Behavior
- Constraint
{"id": "test.TestScript"} - Constraint
{"id": 1}