You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When modifying or creating a Permission for a User in the Admin menu, I have set the first few fields as such:
I select the Group or User I want to apply the Permission to.
For the constraints, I set the field to {"id": "equipment-creation.SatelliteCreationScript"} given the following script
I hit the Save button to save the permission
Expected Behavior
The permission should save, making it so the User or Group only has access to run this particular script given the provided constraints.
Observed Behavior
A server error occurs: Field 'id' expected a number but got 'equipment-creation.SatelliteCreationScript'.
The expectation that the id must be a number is contradictory to the documentation and return result of the API endpoint extra_scripts_list GET. The top right part of the image that shows the script in the Steps to Reproduce indicates the ID is a string. This is further backed by doing the extract_scripts_list call, which returns the following:
As can be seen, the ID is a string not a number.
The text was updated successfully, but these errors were encountered:
Script is not a real model, and as such permission constraints do not work on it, because permission constraints are pretty much just QuerySet filters. However you might be able to do something with Core -> ManagedFile, either with the ìd` field (numeric) or the file path field.
This is not a bug, and while it's probably not going to change, the right way to change it would be a feature request and not a bug report.
NetBox version
v.3.5.4
Python version
3.8
Steps to Reproduce
When modifying or creating a Permission for a User in the Admin menu, I have set the first few fields as such:
I select the Group or User I want to apply the Permission to.
For the constraints, I set the field to
{"id": "equipment-creation.SatelliteCreationScript"}
given the following scriptI hit the Save button to save the permission
Expected Behavior
The permission should save, making it so the User or Group only has access to run this particular script given the provided constraints.
Observed Behavior
A server error occurs:
Field 'id' expected a number but got 'equipment-creation.SatelliteCreationScript'.
The expectation that the id must be a number is contradictory to the documentation and return result of the API endpoint extra_scripts_list GET. The top right part of the image that shows the script in the Steps to Reproduce indicates the ID is a string. This is further backed by doing the extract_scripts_list call, which returns the following:
As can be seen, the ID is a string not a number.
The text was updated successfully, but these errors were encountered: