Sha256: 2f8114039d3a031cd2ff4a12dcbccce345bdd78bb0cb09103c4146f091f81bad

Contents?: true

Size: 594 Bytes

Versions: 13

Compression:

Stored size: 594 Bytes

Contents

Spree::Admin::OrdersController.class_eval do
  before_filter :check_authorization

  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

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
solidus_auth_devise-1.6.0 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
solidus_auth_devise-1.5.0 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
solidus_auth_devise-1.4.0 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
spree_auth_devise-3.1.0 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
spree_auth_devise-3.0.6 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
spree_auth_devise-3.0.5 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
solidus_auth_devise-1.3.0 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
solidus_auth_devise-1.2.3 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
solidus_auth_devise-1.2.2 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
solidus_auth_devise-1.2.1 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
solidus_auth_devise-1.2.0 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
solidus_auth_devise-1.1.0 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb
solidus_auth_devise-1.0.0 lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb