File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1402,7 +1402,7 @@ func SyncExternalUsers() {
1402
1402
} else if updateExisting {
1403
1403
existingUsers = append (existingUsers , usr .ID )
1404
1404
// Check if user data has changed
1405
- if usr .IsAdmin != su .IsAdmin ||
1405
+ if ( len ( s . LDAP (). AdminFilter ) > 0 && usr .IsAdmin != su .IsAdmin ) ||
1406
1406
strings .ToLower (usr .Email ) != strings .ToLower (su .Mail ) ||
1407
1407
usr .FullName != fullName ||
1408
1408
! usr .IsActive {
@@ -1411,7 +1411,10 @@ func SyncExternalUsers() {
1411
1411
1412
1412
usr .FullName = fullName
1413
1413
usr .Email = su .Mail
1414
- usr .IsAdmin = su .IsAdmin
1414
+ // Change existing admin flag only if AdminFilter option is set
1415
+ if len (s .LDAP ().AdminFilter ) > 0 {
1416
+ usr .IsAdmin = su .IsAdmin
1417
+ }
1415
1418
usr .IsActive = true
1416
1419
1417
1420
err = UpdateUser (usr )
You can’t perform that action at this time.
0 commit comments