Skip to content
Snippets Groups Projects
Commit fc39c3e0 authored by stvn's avatar stvn
Browse files

fix: Stop using view_auth_classes helper in discussions API

as it conflicts with the manually-assigned `permission_classes`;
the decorator erases them.
parent 709b8217
No related merge requests found
"""
Handle view-logic for the djangoapp
"""
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from edx_rest_framework_extensions.auth.session.authentication import SessionAuthenticationAllowInactiveUser
from lti_consumer.models import LtiConfiguration
from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
......@@ -8,8 +10,8 @@ from rest_framework import serializers
from rest_framework.response import Response
from rest_framework.views import APIView
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
from openedx.core.lib.api.permissions import IsStaff
from openedx.core.lib.api.view_utils import view_auth_classes
from .models import DEFAULT_PROVIDER_TYPE
from .models import DiscussionsConfiguration
......@@ -67,11 +69,15 @@ class LtiSerializer(serializers.ModelSerializer):
return instance
@view_auth_classes()
class DiscussionsConfigurationView(APIView):
"""
Handle configuration-related view-logic
"""
authentication_classes = (
JwtAuthentication,
BearerAuthenticationAllowInactiveUser,
SessionAuthenticationAllowInactiveUser
)
permission_classes = (IsStaff,)
class Serializer(serializers.ModelSerializer):
......
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