Module: SqAuth::SqAuthHelpers::Sinatra
- Includes:
- DSL, SinatraDSL
- Defined in:
- lib/sq_auth/sq_auth_helpers/sq_auth_helpers_sinatra.rb
Instance Method Summary collapse
Methods included from DSL
#access_action, #access_actions, #draw_for, #sq_auth_access
Methods included from SinatraDSL
Instance Method Details
#create_filter(roles, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/sq_auth/sq_auth_helpers/sq_auth_helpers_sinatra.rb', line 7 def create_filter roles, = {} action = nil action = [*@sq_auth_actions_only].flatten.first if @sq_auth_actions_only if !roles.empty? ok_proc = Proc.new {} error_proc = Proc.new do || throw(:halt, [401, ]) end before(action) do SqAuth.api_filter(roles, ok_proc, error_proc, ) end end end |