summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-08-29 13:05:07 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-09-15 12:21:00 -0500
commitcb85cf1f0a7047c485d7b29b2792b8965e270898 (patch)
treec681b20e379478042e718afa1473af209af126a0 /app/helpers
parent372be2d2e8fe8d607011aa7e2b2fca99eeea007d (diff)
downloadgitlab-ce-cb85cf1f0a7047c485d7b29b2792b8965e270898.tar.gz
Refactor LFS token logic to use a Redis key instead of a DB field, making it a 1 use only token.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/lfs_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/helpers/lfs_helper.rb b/app/helpers/lfs_helper.rb
index 0c867fc8741..2f5709a7395 100644
--- a/app/helpers/lfs_helper.rb
+++ b/app/helpers/lfs_helper.rb
@@ -25,7 +25,11 @@ module LfsHelper
def lfs_download_access?
return false unless project.lfs_enabled?
- project.public? || ci? || lfs_deploy_key? || (user && user.can?(:download_code, project))
+ return true if project.public?
+ return true if ci?
+ return true if lfs_deploy_key?
+
+ (user && user.can?(:download_code, project))
end
def lfs_upload_access?