ldap: fix group validation

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-06-11 17:06:54 -04:00
parent a492ae983c
commit 14ec8472ef
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A
1 changed files with 3 additions and 1 deletions

View File

@ -102,7 +102,9 @@ class MoonrakerLDAP:
if self.group_dn is None:
logging.debug(f"LDAP User {username} login successful")
return True
for group in user.memberOf.value:
if not hasattr(user, "memberOf"):
return False
for group in user.memberOf.values:
if group == self.group_dn:
logging.debug(
f"LDAP User {username} group match success, "