Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: proper permissions for schema endpoints #542

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions chord_metadata_service/experiments/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from rest_framework import mixins, serializers, status, viewsets
from rest_framework.settings import api_settings
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.response import Response

from .serializers import ExperimentSerializer, ExperimentResultSerializer
from .models import Experiment, ExperimentResult
from .schemas import EXPERIMENT_SCHEMA, experiment_resolver, experiment_base_uri
from .filters import ExperimentFilter, ExperimentResultFilter
from chord_metadata_service.authz.permissions import BentoAllowAny
from chord_metadata_service.restapi.constants import MODEL_ID_PATTERN
from chord_metadata_service.restapi.pagination import LargeResultsSetPagination, BatchResultsSetPagination

Expand Down Expand Up @@ -140,7 +140,7 @@ def dispatch(self, *args, **kwargs):
}
)
@api_view(["GET"])
@permission_classes([AllowAny])
@permission_classes([BentoAllowAny])
def get_experiment_schema(_request):
"""
get:
Expand All @@ -151,7 +151,7 @@ def get_experiment_schema(_request):


@api_view(["GET"])
@permission_classes([AllowAny])
@permission_classes([BentoAllowAny])
def get_experiment_subschema(_request, subschema: str):
"""
get:
Expand Down
6 changes: 3 additions & 3 deletions chord_metadata_service/phenopackets/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from rest_framework import viewsets
from rest_framework.settings import api_settings
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.response import Response

from chord_metadata_service.authz.permissions import BentoAllowAny
from chord_metadata_service.restapi.api_renderers import (
PhenopacketsRenderer,
FHIRRenderer,
Expand Down Expand Up @@ -231,7 +231,7 @@ class InterpretationViewSet(PhenopacketsModelViewSet):
}
)
@api_view(["GET"])
@permission_classes([AllowAny])
@permission_classes([BentoAllowAny])
def get_chord_phenopacket_schema(_request):
"""
get:
Expand All @@ -242,7 +242,7 @@ def get_chord_phenopacket_schema(_request):


@api_view(["GET"])
@permission_classes([AllowAny])
@permission_classes([BentoAllowAny])
def get_chord_phenopacket_subschema(_request, subschema: str):
"""
get:
Expand Down