diff --git a/backend/apps/ifc_validation/serializers.py b/backend/apps/ifc_validation/serializers.py index 19c135c..b76547d 100644 --- a/backend/apps/ifc_validation/serializers.py +++ b/backend/apps/ifc_validation/serializers.py @@ -5,7 +5,7 @@ from apps.ifc_validation_models.models import ValidationOutcome -class BaseSerializer(serializers.HyperlinkedModelSerializer): +class BaseSerializer(serializers.ModelSerializer): def get_field_names(self, declared_fields, info): @@ -28,7 +28,8 @@ class Meta: model = ValidationRequest fields = '__all__' show = ["public_id", "model_public_id"] - hide = ["id", "model"] + hide = ["id"] + read_only_fields = ['size', 'created_by'] class ValidationTaskSerializer(BaseSerializer): diff --git a/backend/core/settings.py b/backend/core/settings.py index ce1d9af..8ad5714 100644 --- a/backend/core/settings.py +++ b/backend/core/settings.py @@ -134,7 +134,11 @@ 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.BasicAuthentication', 'rest_framework.authentication.SessionAuthentication', - ] + 'rest_framework.authentication.TokenAuthentication', + ], + 'DEFAULT_PERMISSION_CLASSES':( + 'rest_framework.permissions.IsAuthenticated', + ), } SPECTACULAR_SETTINGS = {