From 8345aa95be015113a8cb280a394c61345cb49ed2 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Wed, 21 Jun 2023 08:41:49 -0500 Subject: [PATCH] Fixes #70 - Add menu permissions --- netbox_config_backup/navigation.py | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/netbox_config_backup/navigation.py b/netbox_config_backup/navigation.py index 2f3d764..b935b63 100644 --- a/netbox_config_backup/navigation.py +++ b/netbox_config_backup/navigation.py @@ -2,21 +2,22 @@ from utilities.choices import ButtonColorChoices item = PluginMenuItem( - link='plugins:netbox_config_backup:backup_list', - link_text='Devices', - buttons=[ - PluginMenuButton( - link="plugins:netbox_config_backup:backup_add", - title="Add", - icon_class="mdi mdi-plus", - color=ButtonColorChoices.GREEN, - ), - ] - ) + link='plugins:netbox_config_backup:backup_list', + link_text='Devices', + permissions=['netbox_config_backup.view_backups'], + buttons=[ + PluginMenuButton( + link="plugins:netbox_config_backup:backup_add", + title="Add", + icon_class="mdi mdi-plus", + color=ButtonColorChoices.GREEN, + ), + ] +) menu = PluginMenu( - label="Configuration Backup", - groups=( - ('Backup Jobs', (item,)), - ) + label="Configuration Backup", + groups=( + ('Backup Jobs', (item,)), ) +)