Skip to content

Commit

Permalink
Check for edit permission when showing store credit edit link
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
spaghetticode committed Nov 16, 2020
1 parent 3c8ffcc commit 682e939
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/store_credits/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<span><%= t store_credit.invalidated? ? 'spree.say_yes' : 'spree.say_no' %></span>
</td>
<td class="actions" data-hook="admin_store_credits_index_row_actions">
<% 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 %>
</td>
Expand Down

0 comments on commit 682e939

Please sign in to comment.