Add django-rules

This commit is contained in:
Tobias Kunze 2025-03-20 15:36:40 +01:00
parent b6571ede2c
commit 34df06939a
3 changed files with 14 additions and 0 deletions

View file

@ -97,6 +97,7 @@ INSTALLED_APPS = [
"django.contrib.staticfiles",
"django.forms",
"template_partials",
"rules",
# The frontend app is loaded early in order to supersede some allauth views/behaviour
"servala.frontend",
"allauth",
@ -170,6 +171,7 @@ ACCOUNT_SIGNUP_FIELDS = ["email*", "password1*", "password2*"]
ACCOUNT_SIGNUP_FORM_CLASS = "servala.frontend.forms.auth.ServalaSignupForm"
AUTHENTICATION_BACKENDS = [
"rules.permissions.ObjectPermissionBackend",
# Needed to login by username in Django admin, regardless of `allauth`
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",