Class: Spree::Api::BaseController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Spree::Api::BaseController
- Includes:
- ControllerSetup, Core::ControllerHelpers::Store, Core::ControllerHelpers::StrongParameters
- Defined in:
- app/controllers/spree/api/base_controller.rb
Direct Known Subclasses
V1::AddressesController, V1::CheckoutsController, V1::ClassificationsController, V1::CountriesController, V1::CreditCardsController, V1::CustomerReturnsController, V1::ImagesController, V1::InventoryUnitsController, V1::LineItemsController, V1::OptionTypesController, V1::OptionValuesController, V1::OrdersController, V1::PaymentsController, V1::ProductPropertiesController, V1::ProductsController, V1::PromotionsController, V1::PropertiesController, V1::ReimbursementsController, V1::ReturnAuthorizationsController, V1::ShipmentsController, V1::StatesController, V1::StockItemsController, V1::StockLocationsController, V1::StockMovementsController, V1::StoresController, V1::TaxonomiesController, V1::TaxonsController, V1::UsersController, V1::VariantsController, V1::ZonesController
Instance Attribute Summary collapse
-
#current_api_user ⇒ Object
Returns the value of attribute current_api_user.
Instance Method Summary collapse
- #content_type ⇒ Object
-
#permitted_line_item_attributes ⇒ Object
users should be able to set price when importing orders via api.
Methods included from ControllerSetup
Instance Attribute Details
#current_api_user ⇒ Object
Returns the value of attribute current_api_user.
12 13 14 |
# File 'app/controllers/spree/api/base_controller.rb', line 12 def current_api_user @current_api_user end |
Instance Method Details
#content_type ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'app/controllers/spree/api/base_controller.rb', line 37 def content_type case params[:format] when 'json' 'application/json; charset=utf-8' when 'xml' 'text/xml; charset=utf-8' end end |
#permitted_line_item_attributes ⇒ Object
users should be able to set price when importing orders via api
29 30 31 32 33 34 35 |
# File 'app/controllers/spree/api/base_controller.rb', line 29 def permitted_line_item_attributes if @current_user_roles.include?('admin') super + [:price, :variant_id, :sku] else super end end |