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!)
This commit is contained in:
Oliver 2022-03-25 16:39:43 +11:00
parent 42f03296d2
commit 052d9770ce

View File

@ -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()