Search: see only its own files

This commit is contained in:
Simon Lehericey 2017-02-20 18:07:33 +01:00
parent ab0d8deef1
commit b6fc30fd62
2 changed files with 46 additions and 8 deletions

View file

@ -56,7 +56,10 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
@search_terms = params[:q]
# exact id match?
@dossiers = Dossier.where(id: @search_terms.to_i) if @search_terms.to_i < 2147483647
if @search_terms.to_i != 0
@dossiers = current_gestionnaire.dossiers.where(id: @search_terms.to_i)
end
@dossiers = Dossier.none if @dossiers.nil?
# full text search