di.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  9. <type name="Magento\Webapi\Model\Authorization\OauthUserContext">
  10. <arguments>
  11. <argument name="request" xsi:type="object">Magento\Webapi\Controller\Soap\Request</argument>
  12. </arguments>
  13. </type>
  14. <type name="Magento\Authorization\Model\CompositeUserContext">
  15. <arguments>
  16. <argument name="userContexts" xsi:type="array">
  17. <item name="tokenUserContext" xsi:type="array">
  18. <item name="type" xsi:type="object">Magento\Webapi\Model\Authorization\TokenUserContext</item>
  19. <item name="sortOrder" xsi:type="string">10</item>
  20. </item>
  21. <item name="guestUserContext" xsi:type="array">
  22. <item name="type" xsi:type="object">Magento\Webapi\Model\Authorization\GuestUserContext</item>
  23. <item name="sortOrder" xsi:type="string">100</item>
  24. </item>
  25. </argument>
  26. </arguments>
  27. </type>
  28. <preference for="Magento\Framework\App\FrontControllerInterface" type="Magento\Webapi\Controller\Soap" />
  29. <preference for="Magento\Framework\Model\ActionValidator\RemoveAction" type="Magento\Framework\Model\ActionValidator\RemoveAction\Allowed" />
  30. <type name="Magento\Webapi\Controller\Rest\Router\Route" shared="false" />
  31. <type name="Magento\Webapi\Controller\Soap">
  32. <arguments>
  33. <argument name="soapServer" xsi:type="object">Magento\Webapi\Model\Soap\Server\Proxy</argument>
  34. <argument name="errorProcessor" xsi:type="object">Magento\Framework\Webapi\ErrorProcessor\Proxy</argument>
  35. </arguments>
  36. </type>
  37. <preference for="Magento\Framework\Authorization\RoleLocatorInterface" type="Magento\Webapi\Model\WebapiRoleLocator" />
  38. <type name="Magento\Framework\Authorization">
  39. <plugin name="guestAuthorization" type="Magento\Webapi\Model\Plugin\GuestAuthorization" />
  40. </type>
  41. <!-- Configuration to check that the permissions are checked on fields -->
  42. <virtualType name="Magento\Framework\Reflection\ExtensionAttributesProcessorPermissionChecked" type="Magento\Framework\Reflection\ExtensionAttributesProcessor">
  43. <arguments>
  44. <argument name="isPermissionChecked" xsi:type="boolean">true</argument>
  45. <argument name="dataObjectProcessor" xsi:type="object">Magento\Framework\Reflection\DataObjectProcessor\Proxy</argument>
  46. </arguments>
  47. </virtualType>
  48. <virtualType name="Magento\Framework\Reflection\DataObjectProcessorPermissionChecked" type="Magento\Framework\Reflection\DataObjectProcessor">
  49. <arguments>
  50. <argument name="extensionAttributesProcessor" xsi:type="object">Magento\Framework\Reflection\ExtensionAttributesProcessorPermissionChecked</argument>
  51. <argument name="customAttributesProcessor" xsi:type="object">Magento\Framework\Reflection\CustomAttributesProcessor\Proxy</argument>
  52. </arguments>
  53. </virtualType>
  54. <type name="Magento\Webapi\Controller\Soap\Request\Handler">
  55. <arguments>
  56. <argument name="dataObjectProcessor" xsi:type="object">Magento\Framework\Reflection\DataObjectProcessorPermissionChecked</argument>
  57. </arguments>
  58. </type>
  59. <!-- End of configuration to check that permissions are checked on fields -->
  60. </config>