File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 412412LDAP_USER_FILTER = os .environ .get ('LDAP_USER_FILTER' , 'username' )
413413LDAP_GROUP_BASEDN = os .environ .get ('LDAP_GROUP_BASEDN' , '' )
414414LDAP_GROUP_FILTER = os .environ .get ('LDAP_GROUP_FILTER' , '' )
415+ LDAP_ACTIVE_GROUP = os .environ .get ('LDAP_ACTIVE_GROUP' , '' )
416+ LDAP_STAFF_GROUP = os .environ .get ('LDAP_STAFF_GROUP' , '' )
417+ LDAP_SUPERUSER_GROUP = os .environ .get ('LDAP_SUPERUSER_GROUP' , '' )
415418
416419# Django LDAP backend configuration.
417420# See https://pythonhosted.org/django-auth-ldap/reference.html
435438 scope = ldap .SCOPE_SUBTREE ,
436439 filterstr = "(%s)" % LDAP_GROUP_FILTER
437440 )
441+ AUTH_LDAP_USER_FLAGS_BY_GROUP = {
442+ 'is_active' : LDAP_ACTIVE_GROUP ,
443+ 'is_staff' : LDAP_STAFF_GROUP ,
444+ 'is_superuser' : LDAP_SUPERUSER_GROUP ,
445+ }
438446 AUTH_LDAP_GROUP_TYPE = GroupOfNamesType ()
439447 AUTH_LDAP_USER_ATTR_MAP = {
440448 "first_name" : "givenName" ,
You can’t perform that action at this time.
0 commit comments