sources/ldap: don't run membership sync if group sync is disabled

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

#4392
This commit is contained in:
Jens Langhammer 2023-01-09 17:19:50 +01:00
parent 9445354b31
commit b555ccd549
No known key found for this signature in database
1 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,9 @@ class MembershipLDAPSynchronizer(BaseLDAPSynchronizer):
def sync(self) -> int:
"""Iterate over all Users and assign Groups using memberOf Field"""
if not self._source.sync_groups:
self.message("Group syncing is disabled for this Source")
return -1
groups = self._source.connection.extend.standard.paged_search(
search_base=self.base_dn_groups,
search_filter=self._source.group_object_filter,