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:
@ -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 = []
|
||||
|
||||
|
Reference in New Issue
Block a user