From ef3b876bd00bb7ccb5b983615f1c49347585af94 Mon Sep 17 00:00:00 2001 From: Du Peng Date: Thu, 13 Oct 2022 17:56:34 +0200 Subject: [PATCH] (feat) disable create card if store hidden --- app/policies/cart_policy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/policies/cart_policy.rb b/app/policies/cart_policy.rb index 66ca3865d..bfdc32574 100644 --- a/app/policies/cart_policy.rb +++ b/app/policies/cart_policy.rb @@ -3,7 +3,7 @@ # Check the access policies for API::CartController class CartPolicy < ApplicationPolicy def create? - true + !Setting.get('store_hidden') || user&.privileged? end %w[add_item remove_item set_quantity refresh_item validate].each do |action|