fix: allow users to update their locale even when own account update disabled

This commit is contained in:
Elias Schneider
2025-06-02 11:35:13 +02:00
parent 00259f8819
commit 6c00aaa3ef
3 changed files with 3 additions and 15 deletions

View File

@@ -294,10 +294,10 @@ func (s *UserService) updateUserInternal(ctx context.Context, userID string, upd
// Check if this is an LDAP user and LDAP is enabled
isLdapUser := user.LdapID != nil && s.appConfigService.GetDbConfig().LdapEnabled.IsTrue()
allowOwnAccountEdit := s.appConfigService.GetDbConfig().AllowOwnAccountEdit.IsTrue()
// For LDAP users, only allow updating the locale unless it's an LDAP sync
if !isLdapSync && isLdapUser {
// Only update the locale for LDAP users
// For LDAP users or if own account editing is not allowed, only allow updating the locale unless it's an LDAP sync
if !isLdapSync && (isLdapUser || (!allowOwnAccountEdit && !updateOwnUser)) {
user.Locale = updatedUser.Locale
} else {
user.FirstName = updatedUser.FirstName