Sha256: d0512ff186af1dde6001f430ec98dea05b2d592d4cd4d004fd634d2d540c3bf8
Contents?: true
Size: 413 Bytes
Versions: 48
Compression:
Stored size: 413 Bytes
Contents
# frozen_string_literal: true module Spree module PermissionSets class RestrictedStockDisplay < PermissionSets::Base def activate! can [:display, :admin], 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