Sha256: 94ec0df4d6c15af2df0728d61a87766b20b2e8ee98adf3497fc14a1550942c3d

Contents?: true

Size: 619 Bytes

Versions: 4

Compression:

Stored size: 619 Bytes

Contents

module Sufia::SingularSubresourceController
  extend ActiveSupport::Concern

  included do
    load_and_authorize_resource :file, class: 'FileSet', only: :file, id_param: :id
    load_and_authorize_resource :work, class: 'GenericWork', only: :work, id_param: :id
  end

  # Overriding the default behavior from Hydra::Core::ControllerBehavior
  def deny_access(exception)
    if current_user && current_user.persisted?
      redirect_to root_path, alert: exception.message
    else
      session['user_return_to'.freeze] = request.url
      redirect_to new_user_session_path, alert: exception.message
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sufia-7.0.0.beta4 app/controllers/concerns/sufia/singular_subresource_controller.rb
sufia-7.0.0.beta3 app/controllers/concerns/sufia/singular_subresource_controller.rb
sufia-7.0.0.beta2 app/controllers/concerns/sufia/singular_subresource_controller.rb
sufia-7.0.0.beta1 app/controllers/concerns/sufia/singular_subresource_controller.rb