Module: Hyrax::DenyAccessOverrideBehavior

Included in:
CitationsController, DepositorsController, SingularSubresourceController
Defined in:
app/controllers/concerns/hyrax/deny_access_override_behavior.rb

Instance Method Summary collapse

Instance Method Details

#deny_access(exception) ⇒ Object

Overriding the default behavior from Hydra::Core::ControllerBehavior



5
6
7
8
9
10
11
12
# File 'app/controllers/concerns/hyrax/deny_access_override_behavior.rb', line 5

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