Fix permission issue in pickups (PR #800, #799)

This commit is contained in:
lentschi 2021-01-30 11:21:00 +01:00 committed by GitHub
parent a32319572f
commit 67ad202859
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 8 deletions

View file

@ -134,7 +134,13 @@ class OrdersController < ApplicationController
else
s = update_order_amounts
flash[:notice] = (s ? I18n.t('orders.receive.notice', :msg => s) : I18n.t('orders.receive.notice_none'))
redirect_to @order
if current_user.role_orders? || current_user.role_finance?
redirect_to @order
elsif current_user.role_pickup?
redirect_to pickups_path
else
redirect_to receive_order_path(@order)
end
end
end