diff --git a/api/cedar_metadata_templates/views.py b/api/cedar_metadata_templates/views.py index 9af1ea24fa9..73bdca565af 100644 --- a/api/cedar_metadata_templates/views.py +++ b/api/cedar_metadata_templates/views.py @@ -4,21 +4,17 @@ from rest_framework import permissions as drf_permissions from rest_framework.exceptions import NotFound +from api.base import permissions as base_permissions from api.base.filters import ListFilterMixin -# from api.base.parsers import ( -# JSONAPIMultipleRelationshipsParser, -# JSONAPIMultipleRelationshipsParserForRegularJSON, -# ) from api.base.versioning import PrivateVersioning from api.base.views import JSONAPIBaseView -from api.base import permissions as base_permissions -# from api.base.utils import get_user_auth from api.cedar_metadata_templates.serializers import CedarMetadataTemplateSerializer from framework.auth.oauth_scopes import CoreScopes from osf.models import CedarMetadataTemplate class CedarMetadataTemplateList(JSONAPIBaseView, generics.ListAPIView, ListFilterMixin): + permission_classes = ( drf_permissions.IsAuthenticatedOrReadOnly, base_permissions.TokenHasScope, @@ -40,7 +36,9 @@ def get_default_queryset(self): def get_queryset(self): return self.get_queryset_from_request() + class CedarMetadataTemplateDetail(JSONAPIBaseView, generics.RetrieveAPIView): + permission_classes = ( drf_permissions.IsAuthenticatedOrReadOnly, base_permissions.TokenHasScope,