File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,13 @@ def authenticate_credentials(self, key):
2929 if settings .REMOTE_AUTH_BACKEND == 'netbox.authentication.LDAPBackend' :
3030 from netbox .authentication import LDAPBackend
3131 ldap_backend = LDAPBackend ()
32- user = ldap_backend .populate_user (token .user .username )
33- # If the user is found in the LDAP directory use it, if not fallback to the local user
34- if user :
35- return user , token
32+
33+ # Load from LDAP if FIND_GROUP_PERMS is active
34+ if ldap_backend .settings .FIND_GROUP_PERMS :
35+ user = ldap_backend .populate_user (token .user .username )
36+ # If the user is found in the LDAP directory use it, if not fallback to the local user
37+ if user :
38+ return user , token
3639
3740 return token .user , token
3841
You can’t perform that action at this time.
0 commit comments