Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b4437cfa
Commit
b4437cfa
authored
Dec 18, 2018
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use project_search_tabs? for user search check
parent
db0cf709
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+2
-1
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+8
-0
app/views/search/_category.html.haml
app/views/search/_category.html.haml
+1
-1
No files found.
app/helpers/projects_helper.rb
View file @
b4437cfa
...
...
@@ -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
...
...
app/helpers/search_helper.rb
View file @
b4437cfa
...
...
@@ -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
app/views/search/_category.html.haml
View file @
b4437cfa
-
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment