From 052d9770ceb1a31f98f45876b1701584b693932c Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 25 Mar 2022 16:39:43 +1100 Subject: [PATCH 1/3] Override view permissions for plugin list API - It is necessary for *any* logged in user to view this endpoint - This is how the user determines which plugins are available (e.g. for label printing!) --- InvenTree/plugin/api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/InvenTree/plugin/api.py b/InvenTree/plugin/api.py index 9ab3b96724..15eefff286 100644 --- a/InvenTree/plugin/api.py +++ b/InvenTree/plugin/api.py @@ -9,6 +9,7 @@ from django.conf.urls import url, include from rest_framework import generics from rest_framework import status +from rest_framework import permissions from rest_framework.response import Response from common.api import GlobalSettingsPermissions @@ -22,6 +23,11 @@ class PluginList(generics.ListAPIView): - GET: Return a list of all PluginConfig objects """ + # Allow any logged in user to read this endpoint + # This is necessary to allow certain functionality, + # e.g. determining which label printing plugins are available + permission_classes = [permissions.IsAuthenticated] + serializer_class = PluginSerializers.PluginConfigSerializer queryset = PluginConfig.objects.all() From 15a221509b21b92866313f8eb18b83c16050d14d Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 25 Mar 2022 16:40:30 +1100 Subject: [PATCH 2/3] Bump API version --- InvenTree/InvenTree/version.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/InvenTree/InvenTree/version.py b/InvenTree/InvenTree/version.py index bb36b28ff8..f97f134e4a 100644 --- a/InvenTree/InvenTree/version.py +++ b/InvenTree/InvenTree/version.py @@ -12,11 +12,14 @@ import common.models INVENTREE_SW_VERSION = "0.7.0 dev" # InvenTree API version -INVENTREE_API_VERSION = 33 +INVENTREE_API_VERSION = 34 """ Increment this API version number whenever there is a significant change to the API that any clients need to know about +v34 -> 2022-03-25 + - Change permissions for "plugin list" API endpoint (now allows any authenticated user) + v33 -> 2022-03-24 - Adds "plugins_enabled" information to root API endpoint From 6e30ec560334504c8afb5ca55198013bc152465a Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 25 Mar 2022 16:42:20 +1100 Subject: [PATCH 3/3] PEP fix --- InvenTree/plugin/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/plugin/api.py b/InvenTree/plugin/api.py index 15eefff286..5a4ea7bae3 100644 --- a/InvenTree/plugin/api.py +++ b/InvenTree/plugin/api.py @@ -25,7 +25,7 @@ class PluginList(generics.ListAPIView): # Allow any logged in user to read this endpoint # This is necessary to allow certain functionality, - # e.g. determining which label printing plugins are available + # e.g. determining which label printing plugins are available permission_classes = [permissions.IsAuthenticated] serializer_class = PluginSerializers.PluginConfigSerializer