Merge branch 'master' into 5110-workbench-full-text-search
[arvados.git] / apps / workbench / app / controllers / collections_controller.rb
index 36c214c7da8106145a1142fd2d39a8a74a26a776..613ed98f88cc22fb83ee65b3870b20605c5ce419 100644 (file)
@@ -3,13 +3,12 @@ require "arvados/keep"
 class CollectionsController < ApplicationController
   include ActionController::Live
 
-  if Rails.configuration.anonymous_user_token
-    skip_around_filter(:require_thread_api_token,
-                       only: [:show_file, :show_file_links, :show])
-  else
-    skip_around_filter(:require_thread_api_token,
-                       only: [:show_file, :show_file_links])
-  end
+  skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+    Rails.configuration.anonymous_user_token and
+    'show' == ctrl.action_name
+  }
+  skip_around_filter(:require_thread_api_token,
+                     only: [:show_file, :show_file_links])
   skip_before_filter(:find_object_by_uuid,
                      only: [:provenance, :show_file, :show_file_links])
   # We depend on show_file to display the user agreement: