Module: Clearance::Authorization

Extended by:
ActiveSupport::Concern
Included in:
Controller
Defined in:
lib/clearance/authorization.rb

Instance Method Summary collapse

Instance Method Details

#authorizeObject



15
16
17
18
19
20
21
# File 'lib/clearance/authorization.rb', line 15

def authorize
  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"
  
end

#deny_access(flash_message = nil) ⇒ Object



23
24
25
26
27
28
# File 'lib/clearance/authorization.rb', line 23

def deny_access(flash_message = nil)
  respond_to do |format|
    format.any(:js, :json, :xml) { head :unauthorized }
    format.any { redirect_request(flash_message) }
  end
end

#require_loginObject



9
10
11
12
13
# File 'lib/clearance/authorization.rb', line 9

def 
  unless signed_in?
    deny_access
  end
end