14807: Fix admin permissions for containers.
[arvados.git] / services / api / app / controllers / application_controller.rb
index d9990b39b28d18827ed80c470f7090497e91ab4a..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
 
@@ -420,8 +423,7 @@ class ApplicationController < ActionController::Base
     response.headers['Access-Control-Allow-Origin'] = '*'
     response.headers['Access-Control-Allow-Methods'] = 'GET, HEAD, PUT, POST, DELETE'
     response.headers['Access-Control-Allow-Headers'] = 'Authorization, Content-Type'
-    #response.headers['Access-Control-Max-Age'] = '86486400'
-    response.headers['Access-Control-Max-Age'] = '1'
+    response.headers['Access-Control-Max-Age'] = '86486400'
   end
 
   def respond_with_json_by_default
@@ -595,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