Merge branch 'master' into 3198-writable-fuse
[arvados.git] / services / api / app / controllers / arvados / v1 / collections_controller.rb
index 922fa6aa39b1f3b2421fef6536332ab10a7afa6f..44733cdfb82ff1c21c4ca379a723110ebcaf5721 100644 (file)
@@ -1,6 +1,10 @@
 require "arvados/keep"
 
 class Arvados::V1::CollectionsController < ApplicationController
+  def self.limit_index_columns_read
+    ["manifest_text"]
+  end
+
   def create
     if resource_attrs[:uuid] and (loc = Keep::Locator.parse(resource_attrs[:uuid]))
       resource_attrs[:portable_data_hash] = loc.to_s
@@ -33,10 +37,6 @@ class Arvados::V1::CollectionsController < ApplicationController
     end
   end
 
-  def index
-    super
-  end
-
   def find_collections(visited, sp, &b)
     case sp
     when ArvadosModel
@@ -184,8 +184,7 @@ class Arvados::V1::CollectionsController < ApplicationController
   def load_limit_offset_order_params *args
     if action_name == 'index'
       # Omit manifest_text from index results unless expressly selected.
-      @select ||= model_class.api_accessible_attributes(:user).
-        map { |attr_spec| attr_spec.first.to_s } - ["manifest_text"]
+      @select ||= model_class.selectable_attributes - ["manifest_text"]
     end
     super
   end