Method: Mist::Configuration#authorized?

Defined in:
lib/mist/configuration.rb

#authorized?(action, *args) ⇒ Boolean

Invokes the blocks registered by Mist::Configuration#authorize to see if the specified action is authorized. Passes *args into the block.

Returns:

  • (Boolean)


62
63
64
65
66
67
# File 'lib/mist/configuration.rb', line 62

def authorized?(action, *args)
  if authorizations.key?(action) then authorizations[action].call *args
  elsif authorizations.key?(:all) then authorizations[:all].call *args
  else nil
  end
end