add django-guardian, djangorestframework-guardian

This commit is contained in:
Michael Shamoon 2022-12-05 21:02:56 -08:00
parent c0bccc6a95
commit dbaa606a9f
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",