Module: FatModelAuth::ViewHelpers

Defined in:
lib/fat_model_auth/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#allowed_to?(options) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
# File 'lib/fat_model_auth/view_helpers.rb', line 3

def allowed_to?(options)
  authority = options.values.first
  
  get_actions(options).each do |action|
    return true if authority.allows(current_user).send "to_#{action}?"
  end
  return false
end