1
0
Fork 0
mirror of synced 2024-06-03 02:54:32 +12:00
ArchiveBox/archivebox/core/auth_ldap.py
2024-04-25 21:36:11 -07:00

11 lines
363 B
Python

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
print(f'[!] WARNING: Creating new user {user} based on LDAP user {ldap_user} (is_staff={user.is_staff}, is_superuser={user.is_superuser})')