mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-16 05:31:12 +00:00
fix: users can't be updated by admin if self account editing is disabled
This commit is contained in:
@@ -297,7 +297,7 @@ func (s *UserService) updateUserInternal(ctx context.Context, userID string, upd
|
|||||||
allowOwnAccountEdit := s.appConfigService.GetDbConfig().AllowOwnAccountEdit.IsTrue()
|
allowOwnAccountEdit := s.appConfigService.GetDbConfig().AllowOwnAccountEdit.IsTrue()
|
||||||
|
|
||||||
// For LDAP users or if own account editing is not allowed, only allow updating the locale unless it's an LDAP sync
|
// 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)) {
|
if !isLdapSync && (isLdapUser || (!allowOwnAccountEdit && updateOwnUser)) {
|
||||||
user.Locale = updatedUser.Locale
|
user.Locale = updatedUser.Locale
|
||||||
} else {
|
} else {
|
||||||
user.FirstName = updatedUser.FirstName
|
user.FirstName = updatedUser.FirstName
|
||||||
|
|||||||
Reference in New Issue
Block a user