BigW Consortium Gitlab

Commit d3bdd3ba by Marin Jankovski

Do not filter out issues and merge requests related to user right away.

parent 5e017a45
...@@ -48,7 +48,7 @@ class IssuableFinder ...@@ -48,7 +48,7 @@ class IssuableFinder
else else
[] []
end end
elsif current_user && params[:authorized_only].presence elsif current_user && params[:authorized_only].presence && !current_user_related?
klass.of_projects(current_user.authorized_projects).references(:project) klass.of_projects(current_user.authorized_projects).references(:project)
else else
klass.of_projects(ProjectsFinder.new.execute(current_user)).references(:project) klass.of_projects(ProjectsFinder.new.execute(current_user)).references(:project)
...@@ -142,4 +142,8 @@ class IssuableFinder ...@@ -142,4 +142,8 @@ class IssuableFinder
def project def project
Project.where(id: params[:project_id]).first if params[:project_id].present? Project.where(id: params[:project_id]).first if params[:project_id].present?
end end
def current_user_related?
params[:scope] == 'created-by-me' || params[:scope] == 'authored' || params[:scope] == 'assigned-to-me'
end
end end
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