Sha256: 1e2f1f4430e0110fc93d062bcb8261a72b2f149160b08a9b5a47ba1c08d6aab5

Contents?: true

Size: 439 Bytes

Versions: 25

Compression:

Stored size: 439 Bytes

Contents

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

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-5.0.0 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-5.0.0.rc3 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-5.0.0.rc2 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-5.0.0.rc1 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-3.6.0 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-4.0.0 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-4.0.0.rc3 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-4.0.0.rc2 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-4.0.0.rc1 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-3.5.0 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-4.0.0.beta2 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-3.4.2 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-4.0.0.beta1 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-3.4.1 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-3.4.0 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-3.3.0 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-3.2.0 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-3.1.0 app/controllers/concerns/hyrax/deny_access_override_behavior.rb
hyrax-3.0.2 app/controllers/concerns/hyrax/deny_access_override_behavior.rb