Sha256: 6387a18cdf5c0bbda1d2f07adef72835a7b6d78d6e055defa3388cd1fe98e106

Contents?: true

Size: 343 Bytes

Versions: 4

Compression:

Stored size: 343 Bytes

Contents

OrdersController.class_eval do
  before_filter :check_authorization

  private

  def check_authorization
    session[:access_token] ||= params[:token]
    order = Order.find_by_number(params[:id]) || current_order

    if order
      authorize! :edit, order, session[:access_token]
    else
      authorize! :create, Order
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_auth-0.70.7 app/controllers/orders_controller_decorator.rb
spree_auth-0.70.6 app/controllers/orders_controller_decorator.rb
spree_auth-0.60.6 app/controllers/orders_controller_decorator.rb
spree_auth-0.70.5 app/controllers/orders_controller_decorator.rb