Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-04 00:08:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-04 00:08:37 +0300
commitbbaf2bb0438b1c71020d9d216feb528add225a7f (patch)
tree47409ddbb4994ec78c24503416ab44f129f39ec6 /app/finders
parente9c2bf267862e22c0770cc7b3a1ed97a8b87a7fd (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/snippets_finder.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/finders/snippets_finder.rb b/app/finders/snippets_finder.rb
index 5819f279eaa..4f63810423b 100644
--- a/app/finders/snippets_finder.rb
+++ b/app/finders/snippets_finder.rb
@@ -61,9 +61,11 @@ class SnippetsFinder < UnionFinder
def execute
# The snippet query can be expensive, therefore if the
# author or project params have been passed and they don't
- # exist, it's better to return
+ # exist, or if a Project has been passed and has snippets
+ # disabled, it's better to return
return Snippet.none if author.nil? && params[:author].present?
return Snippet.none if project.nil? && params[:project].present?
+ return Snippet.none if project && !project.feature_available?(:snippets, current_user)
items = init_collection
items = by_ids(items)