from rest_framework import viewsets

from ces_fall_rest_api.models.subject_area import SubjectArea
from ces_fall_rest_api.serializers.subject_area_serializer import SubjectAreaSerializer
from rest_framework.permissions import IsAuthenticated


class SubjectAreaViewSet(viewsets.ModelViewSet):
    """A simple viewset to get the all the SubjectArea objects
    This class has a token authentication.

    Args:
        viewsets (_type_): viewsets class
    """
    queryset = SubjectArea.objects.all()
    serializer_class = SubjectAreaSerializer
    permission_classes = [IsAuthenticated]
