mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Merge pull request #2461 from aignatov-bio/ai-sci-4448-hide-uneditable-projects-in-quick-start-widget
Add user check to project filter in quick start widget [SCI-4448]
This commit is contained in:
commit
c9c6d12759
|
@ -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?
|
||||
|
|
Loading…
Reference in a new issue