Module: Clearance::Authorization
- Extended by:
- ActiveSupport::Concern
- Included in:
- Controller
- Defined in:
- lib/clearance/authorization.rb
Instance Method Summary collapse
Instance Method Details
#authorize ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/clearance/authorization.rb', line 15 def warn "[DEPRECATION] Clearance's `authorize` before_filter is " + "deprecated. Use `require_login` instead. Be sure to update any " + "instances of `skip_before_filter :authorize` or " + "`skip_before_action :authorize` as well" require_login end |
#deny_access(flash_message = nil) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/clearance/authorization.rb', line 23 def deny_access( = nil) respond_to do |format| format.any(:js, :json, :xml) { head :unauthorized } format.any { redirect_request() } end end |
#require_login ⇒ Object
9 10 11 12 13 |
# File 'lib/clearance/authorization.rb', line 9 def require_login unless signed_in? deny_access end end |