fix(auth): correctly calculate LDAP teamsync [EE-3704] (#7293)

pull/7310/head
itsconquest 2022-07-21 21:29:34 +12:00 committed by GitHub
parent 54145ce949
commit 4fb1880ddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -95,8 +95,10 @@ func generatePublicSettings(appSettings *portainer.Settings) *publicSettingsResp
} }
} }
//if LDAP authentication is on, compose the related fields from application settings //if LDAP authentication is on, compose the related fields from application settings
if publicSettings.AuthenticationMethod == portainer.AuthenticationLDAP { if publicSettings.AuthenticationMethod == portainer.AuthenticationLDAP && appSettings.LDAPSettings.GroupSearchSettings != nil {
publicSettings.TeamSync = len(appSettings.LDAPSettings.GroupSearchSettings) > 0 if len(appSettings.LDAPSettings.GroupSearchSettings) > 0 {
publicSettings.TeamSync = len(appSettings.LDAPSettings.GroupSearchSettings[0].GroupBaseDN) > 0
}
} }
return publicSettings return publicSettings
} }