mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-16 20:22:53 -06:00
Fix permissions for REST API status view
This commit is contained in:
parent
97c588a8ba
commit
aac930237a
@ -15,6 +15,7 @@ from rest_framework.viewsets import GenericViewSet
|
|||||||
from rq.worker import Worker
|
from rq.worker import Worker
|
||||||
|
|
||||||
from netbox.api import BulkOperationSerializer
|
from netbox.api import BulkOperationSerializer
|
||||||
|
from netbox.api.authentication import IsAuthenticatedOrLoginNotRequired
|
||||||
from netbox.api.exceptions import SerializerNotFound
|
from netbox.api.exceptions import SerializerNotFound
|
||||||
from utilities.api import get_serializer_for_model
|
from utilities.api import get_serializer_for_model
|
||||||
|
|
||||||
@ -233,12 +234,12 @@ class ModelViewSet(mixins.CreateModelMixin,
|
|||||||
|
|
||||||
class StatusView(APIView):
|
class StatusView(APIView):
|
||||||
"""
|
"""
|
||||||
Provide a lightweight read-only endpoint for conveying NetBox's current operational status.
|
A lightweight read-only endpoint for conveying NetBox's current operational status.
|
||||||
"""
|
"""
|
||||||
permission_classes = []
|
permission_classes = [IsAuthenticatedOrLoginNotRequired]
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
# Gather the version number from all installed Django apps
|
# Gather the version numbers from all installed Django apps
|
||||||
installed_apps = {}
|
installed_apps = {}
|
||||||
for app_config in apps.get_app_configs():
|
for app_config in apps.get_app_configs():
|
||||||
app = app_config.module
|
app = app_config.module
|
||||||
|
Loading…
Reference in New Issue
Block a user