X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5c8437e59cbfd13b99d402b42b6bdfc18aa82bf8..f1eb092c311510b60b8c9b00b64407780e2a0302:/apps/workbench/app/controllers/search_controller.rb diff --git a/apps/workbench/app/controllers/search_controller.rb b/apps/workbench/app/controllers/search_controller.rb index 2b0ad7e57a..6f209a5a9e 100644 --- a/apps/workbench/app/controllers/search_controller.rb +++ b/apps/workbench/app/controllers/search_controller.rb @@ -1,6 +1,22 @@ class SearchController < ApplicationController def find_objects_for_index - @objects = Group.contents(limit: @limit, offset: @offset, filters: @filters) + search_what = Group + if params[:project_uuid] + # Special case for "search all things in project": + @filters = @filters.select do |attr, operator, operand| + not (attr == 'owner_uuid' and operator == '=') + end + # Special case for project_uuid is a user uuid: + if ArvadosBase::resource_class_for_uuid(params[:project_uuid]) == User + search_what = User.find params[:project_uuid] + else + search_what = Group.find params[:project_uuid] + end + end + @objects = search_what.contents(limit: @limit, + offset: @offset, + filters: @filters, + include_linked: true) super end