diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-27 18:08:17 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-06 00:54:22 +0300 |
commit | da15471bb1c862111300a9202fe06c6a531fb283 (patch) | |
tree | f7abd2a654f5e32c012a21d48aa522c42fc89bc4 /app | |
parent | 0f54e2ae6c6b5e1d196bf133de5ef92e907ea816 (diff) |
Clarify protocol access check, and make Git HTTP access call more specific.
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/git_http_controller.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/projects/git_http_controller.rb b/app/controllers/projects/git_http_controller.rb index 273be813435..3d0055c9be3 100644 --- a/app/controllers/projects/git_http_controller.rb +++ b/app/controllers/projects/git_http_controller.rb @@ -157,7 +157,7 @@ class Projects::GitHttpController < Projects::ApplicationController end def render_not_allowed - render plain: access.message, status: :forbidden + render plain: download_access.message, status: :forbidden end def ci? @@ -168,20 +168,20 @@ class Projects::GitHttpController < Projects::ApplicationController return false unless Gitlab.config.gitlab_shell.upload_pack if user - access.allowed? + download_access.allowed? else ci? || project.public? end end - def access - return @access if defined?(@access) + def download_access + return @download_access if defined?(@download_access) - @access = Gitlab::GitAccess.new(user, project, 'http').check('git-upload-pack') + @download_access = Gitlab::GitAccess.new(user, project, 'http').check('git-upload-pack') end def http_blocked? - access.message.include?('HTTP') + download_access.protocol_allowed? end def receive_pack_allowed? |