Skip to content
Snippets Groups Projects
Commit 1e5ea6e7 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Return only labels that user have access on IssuableFinder#labels

parent 530aae90
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
 
Loading
Loading
Loading
Loading
@@ -45,7 +45,7 @@ class LabelsFinder < UnionFinder
params[:project_id].presence
end
 
def project_ids
def projects_ids
params[:project_ids].presence
end
 
Loading
Loading
@@ -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: projects_ids) if projects_ids
@projects = @projects.reorder(nil)
 
@projects
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment