Skip to content

Server error when creating permission constraints for extras > script #15174

@julianstolp

Description

@julianstolp

Deployment Type

Self-hosted

NetBox Version

v3.7.2

Python Version

3.10

Steps to Reproduce

  1. 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:
image

  1. Go to /users/permissions/add/ and create a viewing permission for Extras > Script with the following constraint. Keep in mind Choices are: id only
  2. 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

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

  1. Constraint {"id": "test.TestScript"}
    image
  2. Constraint {"id": 1}
    image

Metadata

Metadata

Assignees

Labels

severity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions