Sha256: 09df488f994359002e9784324ba68492ad919fbbe4e9204562e528cc21c44ba2

Contents?: true

Size: 856 Bytes

Versions: 6

Compression:

Stored size: 856 Bytes

Contents

if Cardboard.user_class
  Cardboard.user_class.class_eval do

    # has_many :cardboard_blog_posts, :class_name => "CardboardBlog::Post", :foreign_key => "user_id"

    # User class should overwrite these methods with his own
    # ['pages', 'settings'].each do |m|
    #   method = "can_manage_cardboard_#{m}?"
    #   unless method_defined?(method.to_sym)
    #     define_method method do
    #       true
    #     end
    #   end
    # end
    unless method_defined?(:can_manage_cardboard_pages?)
      def can_manage_cardboard_pages?
        true
      end
    end
    unless method_defined?(:can_manage_cardboard_settings?)
      def can_manage_cardboard_settings?
        true
      end
    end
    unless method_defined?(:can_manage_cardboard_resource?)
      def can_manage_cardboard_resource?(resource)
        true
      end
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cardboard_cms-0.3.1 app/decorators/lib/cardboard/user_class_decorator.rb
cardboard_cms-0.2.2 app/decorators/lib/cardboard/user_class_decorator.rb
cardboard_cms-0.2.1 app/decorators/lib/cardboard/user_class_decorator.rb
cardboard_cms-0.1.8 app/decorators/lib/cardboard/user_class_decorator.rb
cardboard_cms-0.1.6 app/decorators/lib/cardboard/user_class_decorator.rb
cardboard_cms-0.1.4 app/decorators/lib/cardboard/user_class_decorator.rb