1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class SearchController < ApplicationController
6 def find_objects_for_index
8 if params[:project_uuid]
9 # Special case for "search all things in project":
10 @filters = @filters.select do |attr, operator, operand|
11 not (attr == 'owner_uuid' and operator == '=')
13 # Special case for project_uuid is a user uuid:
14 if ArvadosBase::resource_class_for_uuid(params[:project_uuid]) == User
15 search_what = User.find params[:project_uuid]
17 search_what = Group.find params[:project_uuid]
20 @objects = search_what.contents(limit: @limit,
24 last_object_class: params["last_object_class"],
29 def next_page_href with_params={}
30 super with_params.merge(last_object_class: @objects.last.class.to_s,
31 project_uuid: params[:project_uuid],
34 filters: @filters.to_json)