populate is_staff and is_superuser flags at LDAP authentication

This commit is contained in:
Vladimir D 2024-01-24 22:18:02 +04:00
parent a2cfe764d4
commit 95580ee743
5 changed files with 32 additions and 0 deletions
archivebox/core

View file

@ -0,0 +1,11 @@
from django.conf import settings
from ..config import (
LDAP_CREATE_SUPERUSER
)
def create_user(sender, user=None, ldap_user=None, **kwargs):
if not user.id and LDAP_CREATE_SUPERUSER:
user.is_superuser = True
user.is_staff = True