Commit 97058207 authored by mortyccp's avatar mortyccp

Fix lint error

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