summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-11-10 20:04:00 -0600
committerPatricio Cano <suprnova32@gmail.com>2016-11-10 20:04:00 -0600
commit50f047cadd6db4bc6e9f08beefbdf48f35ef876c (patch)
tree124cd5b28f1c475cf058ec388ceda0ff1f8e7862 /app/helpers
parenta3fd8521fb036b1f7153cad58234e8cb08246278 (diff)
downloadgitlab-ce-50f047cadd6db4bc6e9f08beefbdf48f35ef876c.tar.gz
Move the `objects` method to `LfsHelper` so that it is also available to `LfsStorageController`24392-lfs-helper-refactor
It is needed for the `lfs_check_access!` callback when the repository size limit is enabled (EE only).
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/lfs_helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/lfs_helper.rb b/app/helpers/lfs_helper.rb
index d3966ba1f10..2425c3a8bc8 100644
--- a/app/helpers/lfs_helper.rb
+++ b/app/helpers/lfs_helper.rb
@@ -30,6 +30,10 @@ module LfsHelper
ci? || lfs_deploy_token? || user_can_download_code? || build_can_download_code?
end
+ def objects
+ @objects ||= (params[:objects] || []).to_a
+ end
+
def user_can_download_code?
has_authentication_ability?(:download_code) && can?(user, :download_code, project)
end