Sha256: b47bcbcda5b94b01d821b7dc562defee91f845c1b660fcf51274b1af8bb908f2

Contents?: true

Size: 871 Bytes

Versions: 9

Compression:

Stored size: 871 Bytes

Contents

module CabooseStore
  class CabooseStorePlugin < Caboose::CaboosePlugin
  
    def self.admin_nav(nav, user = nil, page = nil)
      return nav if user.nil?
      
      item = {
        'id' => 'general-store',
        'text' => 'General Store',
        'children' => []
      }
              
      item['children'] << { 'id' => 'categories', 'href' => '/admin/categories' , 'text' => 'Categories'  , 'modal' => false } if user.is_allowed('categories' , 'view')
      item['children'] << { 'id' => 'products'  , 'href' => '/admin/products'   , 'text' => 'Products'    , 'modal' => false } if user.is_allowed('products'   , 'view')
      item['children'] << { 'id' => 'orders'    , 'href' => '/admin/orders'     , 'text' => 'Orders'      , 'modal' => false } if user.is_allowed('orders'     , 'view')    
  
      nav << item    
      return nav
    end
    
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
caboose-store-0.0.10 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.9 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.8 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.7 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.6 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.5 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.4 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.3 app/models/caboose_store/caboose_store_plugin.rb
caboose-store-0.0.2 app/models/caboose_store/caboose_store_plugin.rb