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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
1e5ea6e7
Commit
1e5ea6e7
authored
Oct 17, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return only labels that user have access on IssuableFinder#labels
parent
530aae90
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+5
-8
app/finders/labels_finder.rb
app/finders/labels_finder.rb
+2
-2
No files found.
app/finders/issuable_finder.rb
View file @
1e5ea6e7
...
...
@@ -124,14 +124,11 @@ class IssuableFinder
def
labels
return
@labels
if
defined?
(
@labels
)
@labels
=
if
labels?
&&
!
filter_by_no_label?
@labels
=
Label
.
where
(
title:
label_names
)
if
projects
@labels
=
LabelsFinder
.
new
(
current_user
,
project_ids:
projects
,
title:
label_names
).
execute
end
LabelsFinder
.
new
(
current_user
,
project_ids:
projects
,
title:
label_names
).
execute
else
@labels
=
Label
.
none
Label
.
none
end
end
...
...
app/finders/labels_finder.rb
View file @
1e5ea6e7
...
...
@@ -45,7 +45,7 @@ class LabelsFinder < UnionFinder
params
[
:project_id
].
presence
end
def
project_ids
def
project
s
_ids
params
[
:project_ids
].
presence
end
...
...
@@ -70,7 +70,7 @@ class LabelsFinder < UnionFinder
@projects
=
available_projects
@projects
=
@projects
.
in_namespace
(
group_id
)
if
group_id
@projects
=
@projects
.
where
(
id:
project
_ids
)
if
project
_ids
@projects
=
@projects
.
where
(
id:
project
s_ids
)
if
projects
_ids
@projects
=
@projects
.
reorder
(
nil
)
@projects
...
...
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