Sha256: 6e5f81b883597df7c6c6bfba096564c8d7c23aebd8e2ce7c208afffa89aa356c
Contents?: true
Size: 700 Bytes
Versions: 5
Compression:
Stored size: 700 Bytes
Contents
module Spree::Auth::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::Auth::Admin::OrdersControllerDecorator)
Version data entries
5 entries across 5 versions & 1 rubygems