From fa0ff8be39caa8c0d73668efea32ff60ec5b34d4 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 16 Jun 2020 13:06:03 -0400 Subject: [PATCH] Restrict ExportTemplates available via export button --- netbox/utilities/templatetags/buttons.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox/utilities/templatetags/buttons.py b/netbox/utilities/templatetags/buttons.py index 85f75f79e..da40ce9d5 100644 --- a/netbox/utilities/templatetags/buttons.py +++ b/netbox/utilities/templatetags/buttons.py @@ -97,7 +97,8 @@ def import_button(url): @register.inclusion_tag('buttons/export.html', takes_context=True) def export_button(context, content_type=None): if content_type is not None: - export_templates = ExportTemplate.objects.filter(content_type=content_type) + user = context['request'].user + export_templates = ExportTemplate.objects.restrict(user, 'view').filter(content_type=content_type) else: export_templates = []