Merge pull request #2773 from SchrodingersGat/plugin-api-permissions

Plugin api permissions
This commit is contained in:
Oliver 2022-03-25 17:21:32 +11:00 committed by GitHub
commit db61c39400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

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

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