Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Added :reposition to global WRITE actions of Platform API
Damian Legawiec89e571b84df4
diff --git a/api/app/controllers/spree/api/v2/platform/menu_items_controller.rb b/api/app/controllers/spree/api/v2/platform/menu_items_controller.rbindex 6442c560aa..36f80b2985 100644--- a/api/app/controllers/spree/api/v2/platform/menu_items_controller.rb+++ b/api/app/controllers/spree/api/v2/platform/menu_items_controller.rb@@ -3,8 +3,6 @@ module Spreemodule V2module Platformclass MenuItemsController < ResourceController- before_action -> { doorkeeper_authorize! :write, :admin }, only: WRITE_ACTIONS << :reposition-def repositionspree_authorize! :update, @moved_itemdiff --git a/api/app/controllers/spree/api/v2/platform/resource_controller.rb b/api/app/controllers/spree/api/v2/platform/resource_controller.rbindex 3656ea2c1c..b0da450f8e 100644--- a/api/app/controllers/spree/api/v2/platform/resource_controller.rb+++ b/api/app/controllers/spree/api/v2/platform/resource_controller.rb@@ -4,7 +4,7 @@ module Spreemodule Platformclass ResourceController < ::Spree::Api::V2::ResourceControllerREAD_ACTIONS = %i[show index]- WRITE_ACTIONS = %i[create update destroy]+ WRITE_ACTIONS = %i[create update destroy reposition]# doorkeeper scopes usage: https://github.com/doorkeeper-gem/doorkeeper/wiki/Using-Scopesbefore_action -> { doorkeeper_authorize! :read, :admin }, only: READ_ACTIONS