Device type import access denied when using groups/permissions #8637

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

Originally created by @huttmf on GitHub (Sep 18, 2023).

NetBox version

3.5.9

Python version

3.8

Steps to Reproduce

Starting with a clean install of NetBox 3.5.9:

  1. Create a group with view, add, change, delete permissions for the device-type object.
  2. Add a test user to this group.
  3. Login with test user, go to Device Types and click the import button.

I only see this issue with device types. All other object imports seem to work fine when groups and permissions are being specified.

Expected Behavior

Expected to see the import UI

image

Observed Behavior

image
Forbidden (Permission denied): /dcim/device-types/import/
Traceback (most recent call last):
  File "/opt/netbox-3.5.8/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 56, in inner
    response = get_response(request)
  File "/opt/netbox-3.5.8/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox-3.5.8/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 103, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox-3.5.9/netbox/netbox/views/generic/base.py", line 77, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox-3.5.9/netbox/utilities/views.py", line 97, in dispatch
    return self.handle_no_permission()
  File "/opt/netbox-3.5.8/venv/lib/python3.8/site-packages/django/contrib/auth/mixins.py", line 48, in handle_no_permission
    raise PermissionDenied(self.get_permission_denied_message())
django.core.exceptions.PermissionDenied
[18/Sep/2023 18:59:30] "GET /dcim/device-types/import/ HTTP/1.1" 403 13575
Originally created by @huttmf on GitHub (Sep 18, 2023). ### NetBox version 3.5.9 ### Python version 3.8 ### Steps to Reproduce Starting with a clean install of NetBox 3.5.9: 1. Create a group with view, add, change, delete permissions for the device-type object. 2. Add a test user to this group. 3. Login with test user, go to Device Types and click the import button. I only see this issue with device types. All other object imports seem to work fine when groups and permissions are being specified. ### Expected Behavior Expected to see the import UI <img width="1037" alt="image" src="https://github.com/netbox-community/netbox/assets/5199425/74726e52-4c9c-4ff7-a613-dc1a76f225ce"> ### Observed Behavior <img width="1159" alt="image" src="https://github.com/netbox-community/netbox/assets/5199425/4bb4f355-e771-4130-b522-59c8d1ccb67a"> ``` Forbidden (Permission denied): /dcim/device-types/import/ Traceback (most recent call last): File "/opt/netbox-3.5.8/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 56, in inner response = get_response(request) File "/opt/netbox-3.5.8/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/netbox-3.5.8/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 103, in view return self.dispatch(request, *args, **kwargs) File "/opt/netbox-3.5.9/netbox/netbox/views/generic/base.py", line 77, in dispatch return super().dispatch(request, *args, **kwargs) File "/opt/netbox-3.5.9/netbox/utilities/views.py", line 97, in dispatch return self.handle_no_permission() File "/opt/netbox-3.5.8/venv/lib/python3.8/site-packages/django/contrib/auth/mixins.py", line 48, in handle_no_permission raise PermissionDenied(self.get_permission_denied_message()) django.core.exceptions.PermissionDenied [18/Sep/2023 18:59:30] "GET /dcim/device-types/import/ HTTP/1.1" 403 13575 ```
adam closed this issue 2025-12-29 20:39:10 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 19, 2023):

The device type import view requires additional permissions for creating component templates as well:

252bf03525/netbox/dcim/views.py (L1086-L1099)

This particular view will not be accessible to a user without these permissions assigned.

@jeremystretch commented on GitHub (Sep 19, 2023): The device type import view requires additional permissions for creating component templates as well: https://github.com/netbox-community/netbox/blob/252bf035250d8d8a336183578081e7f5b27c285c/netbox/dcim/views.py#L1086-L1099 This particular view will not be accessible to a user without these permissions assigned.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8637