module FatModelAuth::ViewHelpers

Public Instance Methods

allowed_to?(options) click to toggle source
# File lib/fat_model_auth/view_helpers.rb, line 3
def allowed_to?(options)
  actions, authority = options.first

  actions.to_s.split('_or_').any? do |action|
    authority.allows(current_user).send "to_#{action}?"
  end
end