Sha256: 6c942942c0878efd58785ad348830c9c4a5c324202f031be84c3681e2e5607a4
Contents?: true
Size: 662 Bytes
Versions: 17
Compression:
Stored size: 662 Bytes
Contents
module CanTango module Api module User module Can include Ability # Example: generated from types of accounts! (see below) # def admin_can?(*args) # current_ability(:admin).can?(*args) # end def self.included(base) ::CanTango.config.users.registered.each do |user| base.class_eval %{ def #{user}_can? *args current_ability(:#{user}).can?(*args) end def #{user}_cannot? *args current_ability(:#{user}).cannot?(*args) end } end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems