Class: Spree::PermissionSets::RestrictedStockManagement
- Inherits:
-
PermissionSets::Base
- Object
- PermissionSets::Base
- Spree::PermissionSets::RestrictedStockManagement
- Defined in:
- app/models/spree/permission_sets/restricted_stock_management.rb
Overview
Full permissions for stock management limited to allowed locations.
This permission set grants full control over all stock items a user has access to their locations. Those locations are also readable by the corresponding ability.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.category ⇒ Object
16 17 18 |
# File 'app/models/spree/permission_sets/restricted_stock_management.rb', line 16 def category :restricted_stock end |
.privilege ⇒ Object
12 13 14 |
# File 'app/models/spree/permission_sets/restricted_stock_management.rb', line 12 def privilege :management end |
Instance Method Details
#activate! ⇒ Object
21 22 23 24 |
# File 'app/models/spree/permission_sets/restricted_stock_management.rb', line 21 def activate! can :manage, Spree::StockItem, stock_location_id: location_ids can :read, Spree::StockLocation, id: location_ids end |