From b898f03767c4d38448f972a953080656e90d39bd Mon Sep 17 00:00:00 2001 From: aignatov-bio Date: Wed, 11 Mar 2020 14:51:21 +0100 Subject: [PATCH] Add user check to project filter in quick start widget --- app/controllers/dashboard/quick_start_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/dashboard/quick_start_controller.rb b/app/controllers/dashboard/quick_start_controller.rb index 6c30529d7..098b92e49 100644 --- a/app/controllers/dashboard/quick_start_controller.rb +++ b/app/controllers/dashboard/quick_start_controller.rb @@ -21,7 +21,7 @@ module Dashboard def project_filter projects = current_team.projects.search(current_user, false, params[:query], 1, current_team) - .where('user_projects.role <= 1') + .where(user_projects: { user_id: current_user.id, role: %i(owner normal_user) }) .select(:id, :name) projects = projects.map { |i| { value: i.id, label: escape_input(i.name) } } if (projects.map { |i| i[:label] }.exclude? params[:query]) && params[:query].present?