Sha256: 740311ff2c2064adb36a02989c48ce8d9e0a614616ccd8ffee3197e891f5fa6d
Contents?: true
Size: 688 Bytes
Versions: 17
Compression:
Stored size: 688 Bytes
Contents
module Spree::Admin::OrdersControllerDecorator def self.prepended(base) base.before_action :check_authorization end private def load_order_action [:edit, :update, :cancel, :resume, :approve, :resend, :open_adjustments, :close_adjustments, :cart] end def check_authorization action = params[:action].to_sym if load_order_action.include?(action) load_order session[:access_token] ||= params[:token] resource = @order || Spree::Order.new authorize! action, resource, session[:access_token] else authorize! :index, Spree::Order end end end Spree::Admin::OrdersController.prepend(Spree::Admin::OrdersControllerDecorator)
Version data entries
17 entries across 17 versions & 1 rubygems