use project_search_tabs? for user search check
This commit is contained in:
parent
db0cf70970
commit
b4437cfaec
3 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue