Skip to content

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

@jeremystretch

Description

@jeremystretch

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

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions