1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #13638: Add optional staff_only attribute to MenuItem (#13639)

* Closes #13638: Add optional staff_only attribute to MenuItem

* Add missing file

* Add release note
This commit is contained in:
Jeremy Stretch
2023-08-31 11:23:44 -04:00
committed by GitHub
parent 2544e2bf18
commit f962fb3b53
4 changed files with 20 additions and 12 deletions

View File

@@ -36,9 +36,10 @@ class PluginMenuItem:
permissions = []
buttons = []
def __init__(self, link, link_text, permissions=None, buttons=None):
def __init__(self, link, link_text, staff_only=False, permissions=None, buttons=None):
self.link = link
self.link_text = link_text
self.staff_only = staff_only
if permissions is not None:
if type(permissions) not in (list, tuple):
raise TypeError("Permissions must be passed as a tuple or list.")