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

Restrict ExportTemplates available via export button

This commit is contained in:
Jeremy Stretch
2020-06-16 13:06:03 -04:00
parent 5d724f6b84
commit fa0ff8be39

View File

@ -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 = []