Skip to content
Snippets Groups Projects
Verified Commit 993c299c authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix permission check in API

parent e64c96a6
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ from oauth2_provider.oauth2_backends import get_oauthlib_core
from oauthlib.common import Request as OauthlibRequest
from rest_framework import generics, serializers
from rest_framework.authentication import BaseAuthentication
from rest_framework.exceptions import APIException, ValidationError
from rest_framework.exceptions import APIException, PermissionDenied, ValidationError
from rest_framework.permissions import BasePermission
from rest_framework.response import Response
from rest_framework.views import APIView
......@@ -133,6 +133,8 @@ class CardPrinterDetails(generics.RetrieveAPIView):
def get_object(self):
token = self.request.auth
if not token:
raise PermissionDenied()
return token.client.card_printers.all().first()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment