Class: Spree::PermissionSets::RestrictedStockDisplay

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

Overview

Read permissions for stock limited to allowed locations.

This permission set allows users to view information about stock items and locations, both of them limited to locations they have access to. Permissions are also granted for the admin panel for items.

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

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

Instance Method Details

#activate!Object



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

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