Merge branch 'api-guard' into 'master'

Make find_user_from_sources extensible for EE

See merge request gitlab-org/gitlab-ce!16924
This commit is contained in:
Rémy Coutable 2018-02-05 11:04:55 +00:00
commit 4ff15fcf8f
1 changed files with 5 additions and 1 deletions

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`)