Enable controlling the display of navigation menu items depending on the user's is_staff status #8549

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

Originally created by @jeremystretch on GitHub (Aug 31, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.6.0

Feature type

New functionality

Proposed functionality

Add an optional staff_only attribute to the MenuItem class, which defaults to False if not set. Any navigation menu item for which staff_only is True will be displayed only if the user's is_staff field is True.

(I also considered proposing a superuser_only attribute, but worried that might encourage poor practice concerning the assignment of permissions.)

Use case

This will allow more fine-grained control over the display of individual menu items, beyond the permissions evaluation logic that's currently in place.

This was prompted by and is necessary to resolve #13620.

Database changes

N/A

External dependencies

N/A

Originally created by @jeremystretch on GitHub (Aug 31, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.6.0 ### Feature type New functionality ### Proposed functionality Add an optional `staff_only` attribute to the MenuItem class, which defaults to False if not set. Any navigation menu item for which `staff_only` is True will be displayed only if the user's `is_staff` field is True. (I also considered proposing a `superuser_only` attribute, but worried that might encourage poor practice concerning the assignment of permissions.) ### Use case This will allow more fine-grained control over the display of individual menu items, beyond the permissions evaluation logic that's currently in place. This was prompted by and is necessary to resolve #13620. ### Database changes N/A ### External dependencies N/A
adam added the status: acceptedtype: feature labels 2025-12-29 20:38:01 +01:00
adam closed this issue 2025-12-29 20:38:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8549