add django-guardian, djangorestframework-guardian

This commit is contained in:
Michael Shamoon
2022-12-05 21:02:56 -08:00
parent 726710e807
commit 8e552eb688
9 changed files with 183 additions and 25 deletions

View File

@@ -171,6 +171,7 @@ INSTALLED_APPS = [
"rest_framework.authtoken",
"django_filters",
"django_celery_results",
"guardian",
] + env_apps
if DEBUG:
@@ -276,6 +277,7 @@ if ENABLE_HTTP_REMOTE_USER:
AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.RemoteUserBackend",
"django.contrib.auth.backends.ModelBackend",
"guardian.backends.ObjectPermissionBackend",
]
REST_FRAMEWORK["DEFAULT_AUTHENTICATION_CLASSES"].append(
"rest_framework.authentication.RemoteUserAuthentication",