Module: WackyCanvas::Authorization
- Extended by:
- ActiveSupport::Concern
- Included in:
- ActionController::Base
- Defined in:
- lib/wacky_canvas/authorization.rb
Instance Method Summary collapse
- #authorize ⇒ Object
-
#current_user ⇒ Object
Finds the user from the Rack Wacky Canvas session.
- #deny_access(flash_message = nil) ⇒ Object
- #signed_in? ⇒ Boolean
- #signed_out? ⇒ Boolean
Instance Method Details
#authorize ⇒ Object
23 24 25 |
# File 'lib/wacky_canvas/authorization.rb', line 23 def deny_access if signed_out? end |
#current_user ⇒ Object
Finds the user from the Rack Wacky Canvas session
11 12 13 |
# File 'lib/wacky_canvas/authorization.rb', line 11 def current_user wacky_canvas_session.current_user end |
#deny_access(flash_message = nil) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/wacky_canvas/authorization.rb', line 27 def deny_access( = nil) flash[:notice] = if if signed_in? redirect_to(url_after_denied_access_when_signed_in) else redirect_to(url_after_denied_access_when_signed_out) end end |
#signed_in? ⇒ Boolean
15 16 17 |
# File 'lib/wacky_canvas/authorization.rb', line 15 def signed_in? wacky_canvas_session.signed_in? end |
#signed_out? ⇒ Boolean
19 20 21 |
# File 'lib/wacky_canvas/authorization.rb', line 19 def signed_out? !signed_in? end |