Commit c9e4a499 authored by Lin Jen-Shin's avatar Lin Jen-Shin

This method was moved in CE:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14528

And in EE we're extending it with: `find_user_by_job_token`
parent 4286f190
......@@ -48,7 +48,8 @@ module API
user =
find_user_from_private_token ||
find_user_from_oauth_token ||
find_user_from_warden
find_user_from_warden ||
find_user_by_job_token
return nil unless user
......
......@@ -429,20 +429,6 @@ module API
end
end
def find_current_user
user =
find_user_by_private_token(scopes: scopes_registered_for_endpoint) ||
doorkeeper_guard(scopes: scopes_registered_for_endpoint) ||
find_user_from_warden ||
find_user_by_job_token
return nil unless user
raise UnauthorizedError unless Gitlab::UserAccess.new(user).allowed? && user.can?(:access_api)
user
end
def sudo!
return unless sudo_identifier
return unless initial_current_user
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment