Module: Hello::RailsController
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/hello/rails_controller.rb,
lib/hello/rails_controller/restrict_by_role.rb
Defined Under Namespace
Modules: ClassMethods
Classes: RestrictByRole
Instance Method Summary
collapse
Instance Method Details
#hello_manager ⇒ Object
48
49
50
|
# File 'lib/hello/rails_controller.rb', line 48
def hello_manager
request.env['hello'] ||= Hello::RequestManager.create(request)
end
|
#hello_store_url_on_session! ⇒ Object
58
59
60
61
62
|
# File 'lib/hello/rails_controller.rb', line 58
def hello_store_url_on_session!
if hello_manager.stateful?
session[:url] = url_for(params.permit!.merge(only_path: true))
end
end
|
77
78
79
|
# File 'lib/hello/rails_controller.rb', line 77
def render_sudo_mode_form
render 'hello/authentication/sudo_mode'
end
|
#sign_up_disabled ⇒ Object
54
55
56
|
# File 'lib/hello/rails_controller.rb', line 54
def sign_up_disabled
Hello.configuration.sign_up_disabled || action_name=='disabled'
end
|
#sudo_mode ⇒ Object
70
71
72
73
74
75
|
# File 'lib/hello/rails_controller.rb', line 70
def sudo_mode
unless sudo_mode?
hello_store_url_on_session!
render_sudo_mode_form
end
end
|
#sudo_mode? ⇒ Boolean
66
67
68
|
# File 'lib/hello/rails_controller.rb', line 66
def sudo_mode?
current_access && current_access.sudo_expires_at.future?
end
|