Sha256: 27f2af28aab4c3c538cbd3d399b1e25a780fc9cc7e122c5f191572523e152375

Contents?: true

Size: 742 Bytes

Versions: 7

Compression:

Stored size: 742 Bytes

Contents

module Sufia::Controller
  extend ActiveSupport::Concern

  included do
    class_attribute :create_work_presenter_class
    self.create_work_presenter_class = Sufia::SelectTypeListPresenter
    # Adds Hydra behaviors into the application controller
    include Hydra::Controller::ControllerBehavior
    helper_method :create_work_presenter
  end

  def current_ability
    user_signed_in? ? current_user.ability : super
  end

  # Override Devise method to redirect to dashboard after signing in
  def after_sign_in_path_for(_resource)
    sufia.dashboard_index_path
  end

  # A presenter for selecting a work type to create
  def create_work_presenter
    @create_work_presenter ||= create_work_presenter_class.new(current_user)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sufia-7.4.1 app/controllers/concerns/sufia/controller.rb
sufia-7.4.0 app/controllers/concerns/sufia/controller.rb
sufia-7.3.1 app/controllers/concerns/sufia/controller.rb
sufia-7.3.0 app/controllers/concerns/sufia/controller.rb
sufia-7.3.0.rc3 app/controllers/concerns/sufia/controller.rb
sufia-7.3.0.rc2 app/controllers/concerns/sufia/controller.rb
sufia-7.3.0.rc1 app/controllers/concerns/sufia/controller.rb