Sha256: f958a1dcd36d99fc682332729a15bc043f67cf5bc8acf5f8dec61c6d208b81a5

Contents?: true

Size: 559 Bytes

Versions: 2

Compression:

Stored size: 559 Bytes

Contents

module Cream::View
  module Role    
    # admin?,  guest? ...
    Cream::Role.available.each do |role|
      class_eval %{
        def #{role}_area &block
          area_for_roles(#{role}, &block)
        end 
        
        def for_#{role}(&block)
          for_roles(#{role}, &block)          
        end
      }
    end
  end
end

module Cream::Helper
  module Role    
    # admin?,  guest? ...
    AuthAssistant::Role.available.each do |role|
      class_eval %{
        def #{role}?
          has_role? :#{role}
        end
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cream-0.5.7 lib/cream/configure/after_init/role_config.rb
cream-0.5.6 lib/cream/configure/after_init/role_config.rb