Device bay permissions affect ability to add Module bays from dropdown #9357

Closed
opened 2025-12-29 20:48:57 +01:00 by adam · 0 comments
Owner

Originally created by @ibuclaw on GitHub (Mar 14, 2024).

Originally assigned to: @ibuclaw on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.4

Python Version

3.11

Steps to Reproduce

  1. Add Module Bay permission to user/group
  2. Remove Device Bay permission from user/group
  3. Go to any Device
  4. Select "Add Components" drop down and note "Module Bay" is missing

Expected Behavior

Module Bay should be visible when user has Module Bay permissions.

Observed Behavior

This is caused by a typo in the if condition guard for the dropdown entry.

{% if perms.dcim.add_devicebay %}
    <li><a class="dropdown-item" href="{% url 'dcim:modulebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_modulebays' pk=object.pk %}">{% trans "Module Bays" %}</a></li>
{% endif %}
{% if perms.dcim.add_devicebay %}
    <li><a class="dropdown-item" href="{% url 'dcim:devicebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_devicebays' pk=object.pk %}">{% trans "Device Bays" %}</a></li>
{% endif %}
Originally created by @ibuclaw on GitHub (Mar 14, 2024). Originally assigned to: @ibuclaw on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.4 ### Python Version 3.11 ### Steps to Reproduce 1. Add Module Bay permission to user/group 2. Remove Device Bay permission from user/group 3. Go to any Device 4. Select "Add Components" drop down and note "Module Bay" is missing ### Expected Behavior Module Bay should be visible when user has Module Bay permissions. ### Observed Behavior This is caused by a typo in the if condition guard for the dropdown entry. ```html {% if perms.dcim.add_devicebay %} <li><a class="dropdown-item" href="{% url 'dcim:modulebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_modulebays' pk=object.pk %}">{% trans "Module Bays" %}</a></li> {% endif %} {% if perms.dcim.add_devicebay %} <li><a class="dropdown-item" href="{% url 'dcim:devicebay_add' %}?device={{ object.pk }}&return_url={% url 'dcim:device_devicebays' pk=object.pk %}">{% trans "Device Bays" %}</a></li> {% endif %} ```
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:48:57 +01:00
adam closed this issue 2025-12-29 20:48:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9357