Make find_user_from_sources extensible for EE

This commit is contained in:
Lin Jen-Shin 2018-02-05 17:44:23 +08:00
parent cf887a8b31
commit bd132dfe72

View file

@ -42,7 +42,7 @@ module API
include Gitlab::Auth::UserAuthFinders
def find_current_user!
user = find_user_from_access_token || find_user_from_warden
user = find_user_from_sources
return unless user
forbidden!('User is blocked') unless Gitlab::UserAccess.new(user).allowed? && user.can?(:access_api)
@ -50,6 +50,10 @@ module API
user
end
def find_user_from_sources
find_user_from_access_token || find_user_from_warden
end
private
# An array of scopes that were registered (using `allow_access_with_scope`)