Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def load_order
@order = Order.find_by_number!(params[:order_id])
authorize! action, @order
end

def model_class
Spree::OrderCancellations
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<% end %>
<% end %>

<% if can?(:short_ship, @order) && @order.inventory_units.cancelable.present? %>
<% if can?(:manage, Spree::OrderCancellations) && @order.inventory_units.cancelable.present? %>
<%= content_tag('li', :class => ('active' if current == 'Cancel Inventory'), :data => {:hook => 'admin_order_tabs_cancel_inventory'}) do %>
<%= link_to_with_icon 'cancel', Spree.t(:cancel_inventory), admin_order_cancellations_path(@order) %>
<% end %>
Expand Down
1 change: 1 addition & 0 deletions core/app/models/spree/permission_sets/order_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def activate!
can :manage, Spree::LineItem
can :manage, Spree::ReturnAuthorization
can :manage, Spree::CustomerReturn
can :manage, Spree::OrderCancellations
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
it { is_expected.to be_able_to(:manage, Spree::ReturnAuthorization) }
it { is_expected.to be_able_to(:manage, Spree::CustomerReturn) }
it { is_expected.to be_able_to(:display, Spree::ReimbursementType) }
it { is_expected.to be_able_to(:manage, Spree::OrderCancellations) }
end

context "when not activated" do
Expand All @@ -29,6 +30,7 @@
it { is_expected.not_to be_able_to(:manage, Spree::ReturnAuthorization) }
it { is_expected.not_to be_able_to(:manage, Spree::CustomerReturn) }
it { is_expected.not_to be_able_to(:display, Spree::ReimbursementType) }
it { is_expected.not_to be_able_to(:manage, Spree::OrderCancellations) }
end
end