Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>
# Skip require_thread_api_token if this is a show action
# for an object uuid that supports anonymous access.
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
'show' == ctrl.action_name and
params['uuid'] and
ERROR_ACTIONS = [:render_error, :render_not_found]
- around_filter :thread_clear
- around_filter :set_current_request_id
- around_filter :set_thread_api_token
+ around_action :thread_clear
+ around_action :set_current_request_id
+ around_action :set_thread_api_token
# Methods that don't require login should
- # skip_around_filter :require_thread_api_token
- around_filter :require_thread_api_token, except: ERROR_ACTIONS
- before_filter :ensure_arvados_api_exists, only: [:index, :show]
- before_filter :set_cache_buster
- before_filter :accept_uuid_as_id_param, except: ERROR_ACTIONS
- before_filter :check_user_agreements, except: ERROR_ACTIONS
- before_filter :check_user_profile, except: ERROR_ACTIONS
- before_filter :load_filters_and_paging_params, except: ERROR_ACTIONS
- before_filter :find_object_by_uuid, except: [:create, :index, :choose] + ERROR_ACTIONS
+ # skip_around_action :require_thread_api_token
+ around_action :require_thread_api_token, except: ERROR_ACTIONS
+ before_action :ensure_arvados_api_exists, only: [:index, :show]
+ before_action :set_cache_buster
+ before_action :accept_uuid_as_id_param, except: ERROR_ACTIONS
+ before_action :check_user_agreements, except: ERROR_ACTIONS
+ before_action :check_user_profile, except: ERROR_ACTIONS
+ before_action :load_filters_and_paging_params, except: ERROR_ACTIONS
+ before_action :find_object_by_uuid, except: [:create, :index, :choose] + ERROR_ACTIONS
theme :select_theme
begin
class CollectionsController < ApplicationController
include ActionController::Live
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
'show' == ctrl.action_name
}
- skip_around_filter(:require_thread_api_token,
+ skip_around_action(:require_thread_api_token,
only: [:show_file, :show_file_links])
- skip_before_filter(:find_object_by_uuid,
+ skip_before_action(:find_object_by_uuid,
only: [:provenance, :show_file, :show_file_links])
# We depend on show_file to display the user agreement:
- skip_before_filter :check_user_agreements, only: :show_file
- skip_before_filter :check_user_profile, only: :show_file
+ skip_before_action :check_user_agreements, only: :show_file
+ skip_before_action :check_user_profile, only: :show_file
RELATION_LIMIT = 5
# SPDX-License-Identifier: AGPL-3.0
class ContainerRequestsController < ApplicationController
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
'show' == ctrl.action_name
}
# SPDX-License-Identifier: AGPL-3.0
class ContainersController < ApplicationController
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
'show' == ctrl.action_name
}
# SPDX-License-Identifier: AGPL-3.0
class HealthcheckController < ApplicationController
- skip_around_filter :thread_clear
- skip_around_filter :set_thread_api_token
- skip_around_filter :require_thread_api_token
- skip_before_filter :ensure_arvados_api_exists
- skip_before_filter :accept_uuid_as_id_param
- skip_before_filter :check_user_agreements
- skip_before_filter :check_user_profile
- skip_before_filter :load_filters_and_paging_params
- skip_before_filter :find_object_by_uuid
+ skip_around_action :thread_clear
+ skip_around_action :set_thread_api_token
+ skip_around_action :require_thread_api_token
+ skip_before_action :ensure_arvados_api_exists
+ skip_before_action :accept_uuid_as_id_param
+ skip_before_action :check_user_agreements
+ skip_before_action :check_user_profile
+ skip_before_action :load_filters_and_paging_params
+ skip_before_action :find_object_by_uuid
- before_filter :check_auth_header
+ before_action :check_auth_header
def check_auth_header
mgmt_token = Rails.configuration.ManagementToken
# SPDX-License-Identifier: AGPL-3.0
class JobsController < ApplicationController
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
'show' == ctrl.action_name
}
# SPDX-License-Identifier: AGPL-3.0
class LogsController < ApplicationController
- before_filter :ensure_current_user_is_admin
+ before_action :ensure_current_user_is_admin
end
# SPDX-License-Identifier: AGPL-3.0
class PipelineInstancesController < ApplicationController
- skip_before_filter :find_object_by_uuid, only: :compare
- before_filter :find_objects_by_uuid, only: :compare
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ skip_before_action :find_object_by_uuid, only: :compare
+ before_action :find_objects_by_uuid, only: :compare
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
'show' == ctrl.action_name
}
# SPDX-License-Identifier: AGPL-3.0
class PipelineTemplatesController < ApplicationController
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
'show' == ctrl.action_name
}
# SPDX-License-Identifier: AGPL-3.0
class ProjectsController < ApplicationController
- before_filter :set_share_links, if: -> { defined? @object and @object}
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ before_action :set_share_links, if: -> { defined? @object and @object}
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
%w(show tab_counts public).include? ctrl.action_name
}
# SPDX-License-Identifier: AGPL-3.0
class RepositoriesController < ApplicationController
- before_filter :set_share_links, if: -> { defined? @object }
+ before_action :set_share_links, if: -> { defined? @object }
def index_pane_list
%w(repositories help)
# SPDX-License-Identifier: AGPL-3.0
class SearchController < ApplicationController
- skip_before_filter :ensure_arvados_api_exists
+ skip_before_action :ensure_arvados_api_exists
def find_objects_for_index
search_what = Group
# SPDX-License-Identifier: AGPL-3.0
class SessionsController < ApplicationController
- skip_around_filter :require_thread_api_token, :only => [:destroy, :logged_out]
- skip_around_filter :set_thread_api_token, :only => [:destroy, :logged_out]
- skip_before_filter :find_object_by_uuid
- skip_before_filter :find_objects_for_index
- skip_before_filter :ensure_arvados_api_exists
+ skip_around_action :require_thread_api_token, :only => [:destroy, :logged_out]
+ skip_around_action :set_thread_api_token, :only => [:destroy, :logged_out]
+ skip_before_action :find_object_by_uuid
+ skip_before_action :find_objects_for_index
+ skip_before_action :ensure_arvados_api_exists
def destroy
session.clear
# SPDX-License-Identifier: AGPL-3.0
class StatusController < ApplicationController
- skip_around_filter :require_thread_api_token
- skip_before_filter :find_object_by_uuid
+ skip_around_action :require_thread_api_token
+ skip_before_action :find_object_by_uuid
def status
# Allow non-credentialed cross-origin requests
headers['Access-Control-Allow-Origin'] = '*'
# SPDX-License-Identifier: AGPL-3.0
class TestsController < ApplicationController
- skip_before_filter :find_object_by_uuid
+ skip_before_action :find_object_by_uuid
def mithril
end
end
# SPDX-License-Identifier: AGPL-3.0
class UserAgreementsController < ApplicationController
- skip_before_filter :check_user_agreements
- skip_before_filter :find_object_by_uuid
- skip_before_filter :check_user_profile
+ skip_before_action :check_user_agreements
+ skip_before_action :find_object_by_uuid
+ skip_before_action :check_user_profile
def index
if unsigned_user_agreements.empty?
# SPDX-License-Identifier: AGPL-3.0
class UsersController < ApplicationController
- skip_around_filter :require_thread_api_token, only: :welcome
- skip_before_filter :check_user_agreements, only: [:welcome, :inactive, :link_account, :merge]
- skip_before_filter :check_user_profile, only: [:welcome, :inactive, :profile, :link_account, :merge]
- skip_before_filter :find_object_by_uuid, only: [:welcome, :activity, :storage]
- before_filter :ensure_current_user_is_admin, only: [:sudo, :unsetup, :setup]
+ skip_around_action :require_thread_api_token, only: :welcome
+ skip_before_action :check_user_agreements, only: [:welcome, :inactive, :link_account, :merge]
+ skip_before_action :check_user_profile, only: [:welcome, :inactive, :profile, :link_account, :merge]
+ skip_before_action :find_object_by_uuid, only: [:welcome, :activity, :storage]
+ before_action :ensure_current_user_is_admin, only: [:sudo, :unsetup, :setup]
def show
if params[:uuid] == current_user.uuid
# SPDX-License-Identifier: AGPL-3.0
class WebsocketController < ApplicationController
- skip_before_filter :find_objects_for_index
+ skip_before_action :find_objects_for_index
def index
end
# SPDX-License-Identifier: AGPL-3.0
class WorkUnitsController < ApplicationController
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
'show_child_component' == ctrl.action_name
}
# SPDX-License-Identifier: AGPL-3.0
class WorkflowsController < ApplicationController
- skip_around_filter :require_thread_api_token, if: proc { |ctrl|
+ skip_around_action :require_thread_api_token, if: proc { |ctrl|
Rails.configuration.anonymous_user_token and
'show' == ctrl.action_name
}