Sha256: 68b2bcf9c14110366ce4df9c49e476acacfb7af99924e65dd5670ea6a386e411

Contents?: true

Size: 566 Bytes

Versions: 17

Compression:

Stored size: 566 Bytes

Contents

module Spree::Admin::Orders::CustomerDetailsControllerDecorator

  def self.prepended(base)
    base.before_action :check_authorization
  end

  private

  def check_authorization
    load_order
    session[:access_token] ||= params[:token]

    resource = @order
    action = params[:action].to_sym
    action = :edit if action == :show # show route renders :edit for this controller

    authorize! action, resource, session[:access_token]
  end
end
Spree::Admin::Orders::CustomerDetailsController.prepend(Spree::Admin::Orders::CustomerDetailsControllerDecorator)

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
spree_auth_devise-4.4.2 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.0.1 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.1.1 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.2.1 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.4.1 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.4.0 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.3.4 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.3.3 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.3.2 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.3.1 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.3.0 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.2.0 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.1.0 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.1.0.rc1 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.0.0 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.0.0.rc2 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb
spree_auth_devise-4.0.0.rc1 lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb