Commit b4437cfa authored by Alexis Reigel's avatar Alexis Reigel

use project_search_tabs? for user search check

parent db0cf709
...@@ -364,7 +364,8 @@ module ProjectsHelper ...@@ -364,7 +364,8 @@ module ProjectsHelper
blobs: :download_code, blobs: :download_code,
commits: :download_code, commits: :download_code,
merge_requests: :read_merge_request, 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 end
......
...@@ -201,4 +201,12 @@ module SearchHelper ...@@ -201,4 +201,12 @@ module SearchHelper
def limited_count(count, limit = 1000) def limited_count(count, limit = 1000)
count > limit ? "#{limit}+" : count count > limit ? "#{limit}+" : count
end end
def search_tabs?(tab)
if @project
project_search_tabs?(:members)
else
can?(current_user, :read_users_list)
end
end
end end
- users = capture_haml do - users = capture_haml do
- if can?(current_user, :read_users_list) - if search_tabs?(:members)
%li{ class: active_when(@scope == 'users') } %li{ class: active_when(@scope == 'users') }
= link_to search_filter_path(scope: 'users') do = link_to search_filter_path(scope: 'users') do
Users Users
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment