From 900f707ff9cebc1e7da9fe3e6fa43f310b307552 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 18 May 2021 11:51:08 +0200 Subject: [PATCH] permission added --- InvenTree/part/templates/part/category_navbar.html | 2 ++ InvenTree/part/views.py | 1 + 2 files changed, 3 insertions(+) diff --git a/InvenTree/part/templates/part/category_navbar.html b/InvenTree/part/templates/part/category_navbar.html index e2cbaf55db..553b03745b 100644 --- a/InvenTree/part/templates/part/category_navbar.html +++ b/InvenTree/part/templates/part/category_navbar.html @@ -30,12 +30,14 @@ + {% if user.is_staff and roles.part.add %}
  • {% trans "Import Parts" %}
  • + {% endif %} {% if category %}
  • diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index b9c4d2ec03..20185b7a1c 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -725,6 +725,7 @@ class PartCreate(AjaxCreateView): class PartImport(FileManagementFormView): ''' Part: Upload file, match to fields and import parts(using multi-Step form) ''' + permission_required = 'part.add' class MyFileManager(FileManager): REQUIRED_HEADERS = [