Support auth_required in PluginMenuItem #18529
Labels
complexity: low
Requires minimal effort to implement
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
NetBox version
v4.2.2
Feature type
New functionality
Proposed functionality
At present the
PluginMenuItem
class is missing theauth_required
attribute which is present on all regularMenuItem
s, and which is necessary for controlling whether the plugin's menu items appear in the nav menu. This attribute needs to be defined with a default ofFalse
.Use case
This is necessary because of this code:
netbox/netbox/utilities/templatetags/navigation.py
Lines 24 to 31 in 5cd7c6d
Which is what determines whether a menu item is shown in the nav menu. Because
auth_required
is not present onPluginMenuItem
, the check on L29 evaluates toFalse
and the menu item is shown regardless of authentication state.Database changes
N/A
External dependencies
N/A
The text was updated successfully, but these errors were encountered: