mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Merge pull request #7928 from kkthxbye-code/fix-7751
Fix #7751: LDAP: Only get API user from ldap when FIND_GROUP_PERMS is on
This commit is contained in:
commit
d5f308d9c9
@ -29,6 +29,9 @@ class TokenAuthentication(authentication.TokenAuthentication):
|
|||||||
if settings.REMOTE_AUTH_BACKEND == 'netbox.authentication.LDAPBackend':
|
if settings.REMOTE_AUTH_BACKEND == 'netbox.authentication.LDAPBackend':
|
||||||
from netbox.authentication import LDAPBackend
|
from netbox.authentication import LDAPBackend
|
||||||
ldap_backend = LDAPBackend()
|
ldap_backend = LDAPBackend()
|
||||||
|
|
||||||
|
# Load from LDAP if FIND_GROUP_PERMS is active
|
||||||
|
if ldap_backend.settings.FIND_GROUP_PERMS:
|
||||||
user = ldap_backend.populate_user(token.user.username)
|
user = ldap_backend.populate_user(token.user.username)
|
||||||
# If the user is found in the LDAP directory use it, if not fallback to the local user
|
# If the user is found in the LDAP directory use it, if not fallback to the local user
|
||||||
if user:
|
if user:
|
||||||
|
Loading…
Reference in New Issue
Block a user