Disable stats access for device owners
Allow only Fairphone staff group members to access stats functions.
Issue: HIC-203
Change-Id: Ic989ae2d0d7a4b68cd57b114e91e2b14c52227fc
diff --git a/crashreport_stats/rest_endpoints.py b/crashreport_stats/rest_endpoints.py
index b5cd108..ba8ea9f 100644
--- a/crashreport_stats/rest_endpoints.py
+++ b/crashreport_stats/rest_endpoints.py
@@ -31,7 +31,6 @@
)
from crashreports.models import Device, Crashreport, HeartBeat, LogFile
from crashreports.permissions import (
- HasRightsOrIsDeviceOwnerDeviceCreation,
HasStatsAccess,
SWAGGER_SECURITY_REQUIREMENTS_ALL,
SWAGGER_SECURITY_REQUIREMENTS_OAUTH,
@@ -64,7 +63,7 @@
class DeviceUpdateHistory(APIView):
"""View the update history of a specific device."""
- permission_classes = (HasRightsOrIsDeviceOwnerDeviceCreation,)
+ permission_classes = (HasStatsAccess,)
@swagger_auto_schema(
operation_description="Get the update history of a device",
@@ -157,7 +156,7 @@
class DeviceReportHistory(APIView):
"""View the report history of a specific device."""
- permission_classes = (HasRightsOrIsDeviceOwnerDeviceCreation,)
+ permission_classes = (HasStatsAccess,)
@swagger_auto_schema(
operation_description="Get the report history of a device",
@@ -318,7 +317,7 @@
class DeviceStat(APIView):
"""View an overview of the statistics of a device."""
- permission_classes = (HasRightsOrIsDeviceOwnerDeviceCreation,)
+ permission_classes = (HasStatsAccess,)
@swagger_auto_schema(
operation_description="Get some general statistics for a device.",
@@ -389,7 +388,7 @@
class LogFileDownload(APIView):
"""View for downloading log files."""
- permission_classes = (HasRightsOrIsDeviceOwnerDeviceCreation,)
+ permission_classes = (HasStatsAccess,)
@swagger_auto_schema(
operation_description="Get a log file.",