Merge branch '14860-fix-collection-versioning'
[arvados.git] / services / api / app / controllers / application_controller.rb
index 8b20c0c1660b7fbb9cf01e5294105dd04189a8e6..3cfe5b54fda2a2a90afa168938ab5ff9e4760064 100644 (file)
@@ -189,7 +189,10 @@ class ApplicationController < ActionController::Base
   end
 
   def find_objects_for_index
-    @objects ||= model_class.readable_by(*@read_users, {:include_trash => (params[:include_trash] || 'untrash' == action_name)})
+    @objects ||= model_class.readable_by(*@read_users, {
+      :include_trash => (params[:include_trash] || 'untrash' == action_name),
+      :include_old_versions => params[:include_old_versions]
+    })
     apply_where_limit_order_params
   end
 
@@ -346,7 +349,7 @@ class ApplicationController < ActionController::Base
     if request.get? and params[:reader_tokens] and
       params[:reader_tokens].size < 100
       secrets = params[:reader_tokens].map { |t|
-        if t.starts_with? "v2/"
+        if t.is_a? String and t.starts_with? "v2/"
           t.split("/")[2]
         else
           t
@@ -594,6 +597,12 @@ class ApplicationController < ActionController::Base
       limit: { type: 'integer', required: false, default: DEFAULT_LIMIT },
       offset: { type: 'integer', required: false, default: 0 },
       count: { type: 'string', required: false, default: 'exact' },
+      cluster_id: {
+        type: 'string',
+        description: "List objects on a remote federated cluster instead of the current one.",
+        location: "query",
+        required: false,
+      },
     }
   end