summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/helpers/search_helper.rb6
-rw-r--r--app/views/search/_category.html.haml2
2 files changed, 7 insertions, 1 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 9c46035057f..9021525784d 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -33,6 +33,12 @@ module SearchHelper
def parse_search_result(result)
Gitlab::ProjectSearchResults.parse_search_result(result)
end
+
+ def show_notes_tab?
+ [:read_merge_request, :download_code, :read_issue, :read_project_snippet].all? do |ability|
+ can?(current_user, :read_merge_request, @project)
+ end
+ end
private
diff --git a/app/views/search/_category.html.haml b/app/views/search/_category.html.haml
index 7ec4aa9998f..df73fb173a8 100644
--- a/app/views/search/_category.html.haml
+++ b/app/views/search/_category.html.haml
@@ -27,7 +27,7 @@
Milestones
%span.badge
= @search_results.milestones_count
- - if can?(current_user, :read_merge_request, @project) || can?(current_user, :read_issue, @project)
+ - if show_notes_tab?
%li{ class: active_when(@scope == 'notes') }
= link_to search_filter_path(scope: 'notes') do
Comments