run script permission constraint #6957

Closed
opened 2025-12-29 19:47:10 +01:00 by adam · 1 comment
Owner

Originally created by @swoga on GitHub (Sep 9, 2022).

NetBox version

v3.3.2

Python version

3.10

Steps to Reproduce

  1. Create a custom script eg. ip_assign.py with class IpAssign
  2. Confirm id via API: /api/extras/scripts/ip_assign.IpAssign
  3. Create a new permission (/admin/users/objectpermission/add) with following properties:
    Actions: Can view
    Additional actions: run
    Object types: Extras > script
    Constraints: {"id": "ip_assign.IpAssign"}
  4. Exception is thrown

Expected Behavior

new permission with constraint to run this script

Observed Behavior

<class 'ValueError'>

Field 'id' expected a number but got 'ip_assign.IpAssign'.

Originally created by @swoga on GitHub (Sep 9, 2022). ### NetBox version v3.3.2 ### Python version 3.10 ### Steps to Reproduce 1. Create a custom script eg. `ip_assign.py` with class `IpAssign` 2. Confirm `id` via API: `/api/extras/scripts/ip_assign.IpAssign` 3. Create a new permission (`/admin/users/objectpermission/add`) with following properties: Actions: `Can view` Additional actions: `run` Object types: `Extras > script` Constraints: `{"id": "ip_assign.IpAssign"}` 5. Exception is thrown ### Expected Behavior new permission with constraint to run this script ### Observed Behavior <class 'ValueError'> Field 'id' expected a number but got 'ip_assign.IpAssign'.
adam closed this issue 2025-12-29 19:47:10 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Sep 9, 2022):

This is not a bug, using the object permissions on individual scripts is not supported. You are welcome to create a feature request instead.

@kkthxbye-code commented on GitHub (Sep 9, 2022): This is not a bug, using the object permissions on individual scripts is not supported. You are welcome to create a feature request instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6957