Merge branch '11803-repo-perms'
[arvados.git] / services / api / app / controllers / arvados / v1 / containers_controller.rb
index 51f15ad84fd94c7c7834e952a14f5d75d6deaf04..3f11b4f5dd5906b1c0730e5a184df9c750dba39c 100644 (file)
@@ -24,6 +24,15 @@ class Arvados::V1::ContainersController < ApplicationController
     end
   end
 
+  def find_objects_for_index
+    super
+    if action_name == 'lock' || action_name == 'unlock'
+      # Avoid loading more fields than we need
+      @objects = @objects.select(:id, :uuid, :state, :priority, :auth_uuid, :locked_by_uuid)
+      @select = %w(uuid state priority auth_uuid locked_by_uuid)
+    end
+  end
+
   def lock
     @object.lock
     show