X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/56ad30382d7d4e11cb0160c5f2e30077e1f41c8b..8c19d0da4331ba9c2605543f70c0f55875f41497:/apps/workbench/app/controllers/collections_controller.rb diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb index 613ed98f88..e883017070 100644 --- a/apps/workbench/app/controllers/collections_controller.rb +++ b/apps/workbench/app/controllers/collections_controller.rb @@ -120,7 +120,9 @@ class CollectionsController < ApplicationController # purposes: it lets us return a useful status code for common errors, and # helps us figure out which token to provide to arv-get. coll = nil - tokens = [Thread.current[:arvados_api_token], params[:reader_token]].compact + tokens = [Thread.current[:arvados_api_token], + params[:reader_token], + (Rails.configuration.anonymous_user_token || nil)].compact usable_token = find_usable_token(tokens) do coll = Collection.find(params[:uuid]) end @@ -264,6 +266,15 @@ class CollectionsController < ApplicationController sharing_popup end + def update + @updates ||= params[@object.resource_param_name.to_sym] + if @updates && (@updates.keys - ["name", "description"]).empty? + # exclude manifest_text since only name or description is being updated + @object.manifest_text = nil + end + super + end + protected def find_usable_token(token_list) @@ -296,7 +307,9 @@ class CollectionsController < ApplicationController return nil end - def file_enumerator(opts) + # Note: several controller and integration tests rely on stubbing + # file_enumerator to return fake file content. + def file_enumerator opts FileStreamer.new opts end