Sha256: 1a54053ca7ecb436eac38d84e515f6600cb32a0145a82c62c082980a263818a0

Contents?: true

Size: 405 Bytes

Versions: 48

Compression:

Stored size: 405 Bytes

Contents

# frozen_string_literal: true

module Spree
  module PermissionSets
    class RestrictedStockManagement < PermissionSets::Base
      def activate!
        can :manage, Spree::StockItem, stock_location_id: location_ids
        can :display, Spree::StockLocation, id: location_ids
      end

      private

      def location_ids
        @ids ||= user.stock_locations.pluck(:id)
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
solidus_core-2.10.5 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.10.3 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.10.2 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.9.6 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.8.6 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.10.1 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.9.5 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.10.0 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.9.4 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.6.6 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.7.4 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.8.5 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.9.3 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.9.2 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.10.0.beta1 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.7.3 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.6.5 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.9.1 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.9.0 lib/spree/permission_sets/restricted_stock_management.rb
solidus_core-2.9.0.rc.1 lib/spree/permission_sets/restricted_stock_management.rb