diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-12-18 09:35:54 +0100 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2019-03-14 18:21:03 +0100 |
commit | b4437cfaecfcd0f48079a2027920e828ea1c7e48 (patch) | |
tree | f0e1792e375cfd466291a09ae444c76b43cbec10 /app | |
parent | db0cf709703f0cc344351d2a8fd28d7d51046296 (diff) | |
download | gitlab-ce-b4437cfaecfcd0f48079a2027920e828ea1c7e48.tar.gz |
use project_search_tabs? for user search check
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/projects_helper.rb | 3 | ||||
-rw-r--r-- | app/helpers/search_helper.rb | 8 | ||||
-rw-r--r-- | app/views/search/_category.html.haml | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 2ac8ddc5244..5496aa4908c 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -364,7 +364,8 @@ module ProjectsHelper blobs: :download_code, commits: :download_code, merge_requests: :read_merge_request, - notes: [:read_merge_request, :download_code, :read_issue, :read_project_snippet] + notes: [:read_merge_request, :download_code, :read_issue, :read_project_snippet], + members: :read_project_member ) end diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 0ee76a51f7d..97fcb200c67 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -201,4 +201,12 @@ module SearchHelper def limited_count(count, limit = 1000) count > limit ? "#{limit}+" : count end + + def search_tabs?(tab) + if @project + project_search_tabs?(:members) + else + can?(current_user, :read_users_list) + end + end end diff --git a/app/views/search/_category.html.haml b/app/views/search/_category.html.haml index 19d7d13512d..df408e5fb60 100644 --- a/app/views/search/_category.html.haml +++ b/app/views/search/_category.html.haml @@ -1,5 +1,5 @@ - users = capture_haml do - - if can?(current_user, :read_users_list) + - if search_tabs?(:members) %li{ class: active_when(@scope == 'users') } = link_to search_filter_path(scope: 'users') do Users |