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:
class JobsController < ApplicationController
- if Rails.configuration.anonymous_user_token
- skip_around_filter :require_thread_api_token, only: :show
- end
+ skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ Rails.configuration.anonymous_user_token and
+ 'show' == ctrl.action_name
+ }
include JobsHelper
class PipelineInstancesController < ApplicationController
skip_before_filter :find_object_by_uuid, only: :compare
before_filter :find_objects_by_uuid, only: :compare
- if Rails.configuration.anonymous_user_token
- skip_around_filter :require_thread_api_token, only: :show
- end
+ skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ Rails.configuration.anonymous_user_token and
+ 'show' == ctrl.action_name
+ }
include PipelineInstancesHelper
include PipelineComponentsHelper
class PipelineTemplatesController < ApplicationController
- if Rails.configuration.anonymous_user_token
- skip_around_filter :require_thread_api_token, only: :show
- end
+ skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ Rails.configuration.anonymous_user_token and
+ 'show' == ctrl.action_name
+ }
include PipelineComponentsHelper
class ProjectsController < ApplicationController
before_filter :set_share_links, if: -> { defined? @object }
- if Rails.configuration.anonymous_user_token
- skip_around_filter :require_thread_api_token, only: [:show, :tab_counts]
- end
+ skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ Rails.configuration.anonymous_user_token and
+ %w(show tab_counts).include? ctrl.action_name
+ }
def model_class
Group