Class: Spree::PermissionSets::StockDisplay

Inherits:
Base
  • Object
show all
Defined in:
lib/spree/permission_sets/stock_display.rb

Overview

Read-only permissions for stock.

This permission set allows users to view information about stock items (also from the admin panel) and stock locations.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Spree::PermissionSets::Base

Class Method Details

.categoryObject



15
16
17
# File 'lib/spree/permission_sets/stock_display.rb', line 15

def category
  :stock
end

.privilegeObject



11
12
13
# File 'lib/spree/permission_sets/stock_display.rb', line 11

def privilege
  :display
end

Instance Method Details

#activate!Object



20
21
22
23
# File 'lib/spree/permission_sets/stock_display.rb', line 20

def activate!
  can [:read, :admin], Spree::StockItem
  can :read, Spree::StockLocation
end