mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-30 14:35:20 -04:00
populate is_staff and is_superuser flags at LDAP authentication
This commit is contained in:
parent
a2cfe764d4
commit
95580ee743
5 changed files with 32 additions and 0 deletions
archivebox/core
11
archivebox/core/auth_ldap.py
Normal file
11
archivebox/core/auth_ldap.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue