summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-09-20 10:10:45 +0000
committerDouwe Maan <douwe@gitlab.com>2016-09-20 10:10:45 +0000
commit667d2350911b2c3cca0545897eb67fda4b7d4b80 (patch)
tree9357cf7a9703fc5dd72a345fcc15255de22d8334 /app
parent95b9421ad3b2678da6e0af0131eafd52cdd0b2a5 (diff)
parent795acf2e4e01f7ddf3a8be73ddc119b4d84a03e3 (diff)
downloadgitlab-ce-667d2350911b2c3cca0545897eb67fda4b7d4b80.tar.gz
Merge branch 'lfs-support-for-ssh-enabled' into 'master'
LFS support for ssh enabled ## What does this MR do? This is follow-up after https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6043 which is falsely shown as merged due to: https://gitlab.com/gitlab-org/gitlab-ce/issues/22334 ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !6413
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/git_http_client_controller.rb8
-rw-r--r--app/helpers/lfs_helper.rb2
2 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/projects/git_http_client_controller.rb b/app/controllers/projects/git_http_client_controller.rb
index d1a2c52d80a..cbfd3cab3dd 100644
--- a/app/controllers/projects/git_http_client_controller.rb
+++ b/app/controllers/projects/git_http_client_controller.rb
@@ -127,9 +127,11 @@ class Projects::GitHttpClientController < Projects::ApplicationController
end
def ci?
- authentication_result.ci? &&
- authentication_project &&
- authentication_project == project
+ authentication_result.ci?(project)
+ end
+
+ def lfs_deploy_token?
+ authentication_result.lfs_deploy_token?(project)
end
def authentication_has_download_access?
diff --git a/app/helpers/lfs_helper.rb b/app/helpers/lfs_helper.rb
index 8e827664681..c15ecc8f86e 100644
--- a/app/helpers/lfs_helper.rb
+++ b/app/helpers/lfs_helper.rb
@@ -25,7 +25,7 @@ module LfsHelper
def lfs_download_access?
return false unless project.lfs_enabled?
- project.public? || ci? || user_can_download_code? || build_can_download_code?
+ project.public? || ci? || lfs_deploy_token? || user_can_download_code? || build_can_download_code?
end
def user_can_download_code?