From 682e9397c558a58f9218f67c49b38b45754a765a Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Mon, 16 Nov 2020 17:29:08 +0100 Subject: [PATCH] Check for edit permission when showing store credit edit link Checking for `show` makes the edit link visible also to users that cannot edit store credits. This is corrected by checking for the `edit` permission. --- backend/app/views/spree/admin/store_credits/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/views/spree/admin/store_credits/index.html.erb b/backend/app/views/spree/admin/store_credits/index.html.erb index 480731f858f..ff90985947f 100644 --- a/backend/app/views/spree/admin/store_credits/index.html.erb +++ b/backend/app/views/spree/admin/store_credits/index.html.erb @@ -56,7 +56,7 @@ <%= t store_credit.invalidated? ? 'spree.say_yes' : 'spree.say_no' %> - <% if can?(:show, store_credit) %> + <% if can?(:edit, store_credit) %> <%= link_to_edit_url admin_user_store_credit_path(@user, store_credit), { no_text: true, class: 'edit' } %> <% end %>