From 0e8a97acb03baf2615f66d6bc8f3b40f0174ae14 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 7 Jun 2021 05:23:13 +0200 Subject: [PATCH] added permissions --- InvenTree/part/api.py | 1 + InvenTree/part/templates/part/internal_prices.html | 12 ++++++++++-- InvenTree/part/templates/part/navbar.html | 2 +- InvenTree/part/templates/part/order_prices.html | 3 +++ InvenTree/part/templates/part/part_pricing.html | 5 +++++ InvenTree/part/views.py | 3 +++ 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py index 8883699f9a..c2785b666f 100644 --- a/InvenTree/part/api.py +++ b/InvenTree/part/api.py @@ -201,6 +201,7 @@ class PartInternalPriceList(generics.ListCreateAPIView): queryset = PartInternalPriceBreak.objects.all() serializer_class = part_serializers.PartInternalPriceSerializer + permission_required = 'roles.sales_order.show' filter_backends = [ DjangoFilterBackend diff --git a/InvenTree/part/templates/part/internal_prices.html b/InvenTree/part/templates/part/internal_prices.html index fdc69ce198..2f54f3bb64 100644 --- a/InvenTree/part/templates/part/internal_prices.html +++ b/InvenTree/part/templates/part/internal_prices.html @@ -13,7 +13,7 @@ {% block details %} {% settings_value "PART_INTERNAL_PRICE" as show_internal_price %} -{% if show_internal_price %} +{% if show_internal_price and roles.sales_order.view %}