diff options
author | James Lopez <james@jameslopez.es> | 2017-06-23 11:34:07 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-06-23 11:41:43 +0200 |
commit | b804db26485ea09dc93269898dc969ed692130a2 (patch) | |
tree | 48ac76727eed23a2815b14e8c5633bbb056f6972 /lib | |
parent | e2e0b175ae43bef44ba5fdc45b4a719aaae83422 (diff) | |
download | gitlab-ce-b804db26485ea09dc93269898dc969ed692130a2.tar.gz |
refactor update user service not to do auth checks
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/internal.rb | 2 | ||||
-rw-r--r-- | lib/api/notification_settings.rb | 2 | ||||
-rw-r--r-- | lib/api/users.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/ldap/access.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/o_auth/user.rb | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index ecfc822ba6a..9b035808693 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -132,7 +132,7 @@ module API return { success: false, message: 'Two-factor authentication is not enabled for this user' } end - ::Users::UpdateService.new(user, user).execute! do |user| + ::Users::UpdateService.new(user).execute! do |user| @codes = user.generate_otp_backup_codes! end diff --git a/lib/api/notification_settings.rb b/lib/api/notification_settings.rb index 5f88488ccee..5d113c94b22 100644 --- a/lib/api/notification_settings.rb +++ b/lib/api/notification_settings.rb @@ -35,7 +35,7 @@ module API new_notification_email = params.delete(:notification_email) if new_notification_email - ::Users::UpdateService.new(current_user, current_user, notification_email: new_notification_email).execute + ::Users::UpdateService.new(current_user, notification_email: new_notification_email).execute end notification_setting.update(declared_params(include_missing: false)) diff --git a/lib/api/users.rb b/lib/api/users.rb index 6d7f2e7e250..175db3a4a18 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -156,7 +156,7 @@ module API user_params[:password_expires_at] = Time.now if user_params[:password].present? - result = ::Users::UpdateService.new(current_user, user, user_params.except(:extern_uid, :provider)).execute + result = ::Users::UpdateService.new(user, user_params.except(:extern_uid, :provider)).execute if result[:status] == :success present user, with: Entities::UserPublic diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb index 998a8a7eb35..8779577258b 100644 --- a/lib/gitlab/ldap/access.rb +++ b/lib/gitlab/ldap/access.rb @@ -16,7 +16,7 @@ module Gitlab def self.allowed?(user) self.open(user) do |access| if access.allowed? - Users::UpdateService.new(user, user, last_credential_check_a: Time.now).execute + Users::UpdateService.new(user, last_credential_check_a: Time.now).execute true else diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb index 8f37f96dcab..b3f453e506d 100644 --- a/lib/gitlab/o_auth/user.rb +++ b/lib/gitlab/o_auth/user.rb @@ -32,7 +32,7 @@ module Gitlab block_after_save = needs_blocking? - Users::UpdateService.new(gl_user, gl_user).execute! + Users::UpdateService.new(gl_user).execute! gl_user.block if block_after_save |