From 2b06fa19ed2cffb890edccdde15205ce4393c38f Mon Sep 17 00:00:00 2001 From: Simone Ianniciello Date: Fri, 10 Nov 2023 17:17:16 +0100 Subject: [PATCH] auth reqr only on prod --- smartreport/settings.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/smartreport/settings.py b/smartreport/settings.py index 07a8603..0245393 100644 --- a/smartreport/settings.py +++ b/smartreport/settings.py @@ -150,14 +150,14 @@ "rest_framework.authentication.BasicAuthentication", "rest_framework.authentication.SessionAuthentication", ), - # UNCOMMENT THIS TO ENABLE PERMISSIONS CHECKS - # - # 'DEFAULT_PERMISSION_CLASSES': [ - # 'smartreport_app.permissions.FullObjectPermission', - # ], 'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'] } +if (os.environ.get("DEBUG").lower() == "false"): + REST_FRAMEWORK["DEFAULT_PERMISSION_CLASSES"] = ( + 'smartreport_app.permissions.FullObjectPermission', + ) + # Internationalization # https://docs.djangoproject.com/en/4.2/topics/i18n/