Make find_user_from_sources extensible for EE
This commit is contained in:
parent
cf887a8b31
commit
bd132dfe72
1 changed files with 5 additions and 1 deletions
|
@ -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`)
|
||||
|
|
Loading…
Reference in a new issue