Skip to content

Commit

Permalink
Merge pull request #4711 from solidusio/backport/v3.1/pr-4705
Browse files Browse the repository at this point in the history
[v3.1] Merge pull request #4705 from jacobherrington/jacobherrington/fix-misusage-of-can-huh-method
  • Loading branch information
waiting-for-dev authored Nov 11, 2022
2 parents 36ca660 + cc729ca commit e567b70
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</tbody>
</table>

<% if can?([:create, :update], Spree::ProductProperty) %>
<% if can?(:create, Spree::ProductProperty) && can?(:update, Spree::ProductProperty) %>
<%= render 'spree/admin/shared/edit_resource_links' %>
<% end %>

Expand Down Expand Up @@ -95,7 +95,7 @@
<% end %>
</tbody>
</table>
<% if can?([:create, :update], Spree::VariantPropertyRule) %>
<% if can?(:create, Spree::VariantPropertyRule) && can?(:update, Spree::VariantPropertyRule) %>
<%= render 'spree/admin/shared/edit_resource_links' %>
<% end %>
</fieldset>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for :page_actions do %>
<% if can?([:admin, :create], Spree::Order) %>
<% if can?(:admin, Spree::Order) && can?(:create, Spree::Order) %>
<li>
<%= link_to t(".create_order"), spree.new_admin_order_path(user_id: @user.id), class: 'btn btn-primary' %>
</li>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/users/items.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</span>
</td>
<td class="order-number">
<% if can?([:admin, :edit], order) %>
<% if can?(:admin, order) && can?(:edit, order) %>
<%= link_to order.number, edit_admin_order_url(order) %>
<% else %>
<%= order.number %>
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/users/orders.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<tr data-hook="admin_orders_index_rows">
<td class="order-completed-at"><%= l(order.completed_at.to_date) if order.completed_at %></td>
<td class="order-number">
<% if can?([:admin, :edit], order) %>
<% if can?(:admin, order) && can?(:edit, order) %>
<%= link_to order.number, edit_admin_order_path(order) %>
<% else %>
<%= order.number %>
Expand Down

0 comments on commit e567b70

Please sign in to comment.