Skip to content

Commit c3b1e64

Browse files
author
Bryant Luk
committed
MAGETWO-36063: Update REST and SOAP controllers to filter out attributes based on ACL
- Use CustomAttributesProcessor
1 parent d6c7043 commit c3b1e64

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

app/code/Magento/Webapi/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<type name="Magento\Framework\Reflection\DataObjectProcessor">
3131
<arguments>
3232
<argument name="extensionAttributesProcessor" xsi:type="object">Magento\Framework\Reflection\ExtensionAttributesProcessor\Proxy</argument>
33+
<argument name="customAttributesProcessor" xsi:type="object">Magento\Framework\Reflection\CustomAttributesProcessor\Proxy</argument>
3334
</arguments>
3435
</type>
3536
<type name="Magento\Integration\Model\ConfigBasedIntegrationManager">

lib/internal/Magento/Framework/Reflection/DataObjectProcessor.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Zend\Code\Reflection\MethodReflection;
1515

1616
/**
17-
* Data object processor for de-serialization using class reflection
17+
* Data object processor for array serialization using class reflection
1818
*/
1919
class DataObjectProcessor
2020
{
@@ -23,11 +23,6 @@ class DataObjectProcessor
2323
*/
2424
private $methodsMapProcessor;
2525

26-
/**
27-
* @var ExtensionAttributesProcessor
28-
*/
29-
private $extensionAttributesProcessor;
30-
3126
/**
3227
* @var TypeCaster
3328
*/
@@ -38,22 +33,35 @@ class DataObjectProcessor
3833
*/
3934
private $fieldNamer;
4035

36+
/**
37+
* @var ExtensionAttributesProcessor
38+
*/
39+
private $extensionAttributesProcessor;
40+
41+
/**
42+
* @var CustomAttributesProcessor
43+
*/
44+
private $customAttributesProcessor;
45+
4146
/**
4247
* @param MethodsMap $methodsMapProcessor
43-
* @param ExtensionAttributesProcessor $extensionAttributesProcessor
4448
* @param TypeCaster $typeCaster
4549
* @param FieldNamer $fieldNamer
50+
* @param CustomAttributesProcessor $customAttributesProcessor
51+
* @param ExtensionAttributesProcessor $extensionAttributesProcessor
4652
*/
4753
public function __construct(
4854
MethodsMap $methodsMapProcessor,
49-
ExtensionAttributesProcessor $extensionAttributesProcessor,
5055
TypeCaster $typeCaster,
51-
FieldNamer $fieldNamer
56+
FieldNamer $fieldNamer,
57+
CustomAttributesProcessor $customAttributesProcessor,
58+
ExtensionAttributesProcessor $extensionAttributesProcessor
5259
) {
5360
$this->methodsMapProcessor = $methodsMapProcessor;
54-
$this->extensionAttributesProcessor = $extensionAttributesProcessor;
5561
$this->typeCaster = $typeCaster;
5662
$this->fieldNamer = $fieldNamer;
63+
$this->extensionAttributesProcessor = $extensionAttributesProcessor;
64+
$this->customAttributesProcessor = $customAttributesProcessor;
5765
}
5866

5967
/**

0 commit comments

Comments
 (0)