diff options
author | mortyccp <mortyccp@gmail.com> | 2018-12-02 11:57:43 +0800 |
---|---|---|
committer | mortyccp <mortyccp@gmail.com> | 2019-01-03 20:28:02 +0800 |
commit | 970582079ad9384920b69957cfd0a6dc92ed4404 (patch) | |
tree | 6c499c78e67a7032bb42e356a1b20b91936e03fb | |
parent | d1fea99deb2b46467c456db17570710d60dd477b (diff) | |
download | gitlab-ce-970582079ad9384920b69957cfd0a6dc92ed4404.tar.gz |
Fix lint error
-rw-r--r-- | lib/gitlab/middleware/go.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/middleware/go.rb b/lib/gitlab/middleware/go.rb index 692e3ab187e..0ef106920dd 100644 --- a/lib/gitlab/middleware/go.rb +++ b/lib/gitlab/middleware/go.rb @@ -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 |