mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-18 04:56:29 -06:00
Restrict ExportTemplates available via export button
This commit is contained in:
parent
5d724f6b84
commit
fa0ff8be39
@ -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 = []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user