Skip to content

Commit 7fc5494

Browse files
committed
magento/graphql-ce#486: Add customer account validation in Quote operations
1 parent d983e25 commit 7fc5494

File tree

16 files changed

+14
-49
lines changed

16 files changed

+14
-49
lines changed

app/code/Magento/CustomerGraphQl/Model/Resolver/ChangePassword.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function resolve(
7373
array $args = null
7474
) {
7575
/** @var ContextInterface $context */
76-
if (false === $context->getExtensionAttributes()->isCustomer()) {
76+
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
7777
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
7878
}
7979

app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomerAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function resolve(
5454
array $args = null
5555
) {
5656
/** @var ContextInterface $context */
57-
if (false === $context->getExtensionAttributes()->isCustomer()) {
57+
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
5858
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
5959
}
6060

app/code/Magento/CustomerGraphQl/Model/Resolver/Customer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function resolve(
5353
array $args = null
5454
) {
5555
/** @var ContextInterface $context */
56-
if (false === $context->getExtensionAttributes()->isCustomer()) {
56+
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
5757
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
5858
}
5959

app/code/Magento/CustomerGraphQl/Model/Resolver/DeleteCustomerAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function resolve(
5454
array $args = null
5555
) {
5656
/** @var ContextInterface $context */
57-
if (false === $context->getExtensionAttributes()->isCustomer()) {
57+
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
5858
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
5959
}
6060

app/code/Magento/CustomerGraphQl/Model/Resolver/RevokeCustomerToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function resolve(
4444
array $args = null
4545
) {
4646
/** @var ContextInterface $context */
47-
if (false === $context->getExtensionAttributes()->isCustomer()) {
47+
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
4848
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
4949
}
5050

app/code/Magento/CustomerGraphQl/Model/Resolver/UpdateCustomer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function resolve(
6262
array $args = null
6363
) {
6464
/** @var ContextInterface $context */
65-
if (false === $context->getExtensionAttributes()->isCustomer()) {
65+
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
6666
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
6767
}
6868

app/code/Magento/CustomerGraphQl/Model/Resolver/UpdateCustomerAddress.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function resolve(
6363
array $args = null
6464
) {
6565
/** @var ContextInterface $context */
66-
if (false === $context->getExtensionAttributes()->isCustomer()) {
66+
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
6767
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
6868
}
6969

app/code/Magento/DownloadableGraphQl/Model/Resolver/CustomerDownloadableProducts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function resolve(
5555
array $args = null
5656
) {
5757
/** @var ContextInterface $context */
58-
if (false === $context->getExtensionAttributes()->isCustomer()) {
58+
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
5959
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
6060
}
6161

app/code/Magento/DownloadableGraphQl/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"php": "~7.1.3||~7.2.0",
77
"magento/module-catalog": "*",
88
"magento/module-downloadable": "*",
9+
"magento/module-graph-ql": "*",
910
"magento/framework": "*"
1011
},
1112
"suggest": {

app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private function createBillingAddress(
102102
if (null === $customerAddressId) {
103103
$billingAddress = $this->quoteAddressFactory->createBasedOnInputData($addressInput);
104104
} else {
105-
if (false === $context->getExtensionAttributes()->isCustomer()) {
105+
if (false === $context->getExtensionAttributes()->getIsCustomer()) {
106106
throw new GraphQlAuthorizationException(__('The current customer isn\'t authorized.'));
107107
}
108108

0 commit comments

Comments
 (0)