Fix lint error

This commit is contained in:
mortyccp 2018-12-02 11:57:43 +08:00
parent d1fea99deb
commit 970582079a

View file

@ -132,13 +132,16 @@ module Gitlab
def current_user_from_basic_authentication?(request, project) def current_user_from_basic_authentication?(request, project)
return unless has_basic_credentials?(request) return unless has_basic_credentials?(request)
login, password = user_name_and_password(request) login, password = user_name_and_password(request)
auth_result = Gitlab::Auth.find_for_git_client(login, password, project: project, ip: request.ip) auth_result = Gitlab::Auth.find_for_git_client(login, password, project: project, ip: request.ip)
return unless auth_result.success? return unless auth_result.success?
return unless auth_result.actor&.can?(:access_api) return unless auth_result.actor&.can?(:access_api)
if auth_result.type == :personal_access_token if auth_result.type == :personal_access_token
apiScopeAbilities = Gitlab::Auth.abilities_for_scopes([:api]) api_sceope_abilities = Gitlab::Auth.abilities_for_scopes([:api])
return unless auth_result.authentication_abilities.sort == apiScopeAbilities.sort return unless auth_result.authentication_abilities.sort == api_sceope_abilities.sort
end end
auth_result.actor auth_result.actor