Skip to content

Commit c689798

Browse files
committed
#28563: GraphQL product search does not consider Category Permissions configuration - Pass the context as argument
Reveert AddUsserInfoToContext
1 parent a675e30 commit c689798

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

app/code/Magento/CustomerGraphQl/Model/Context/AddUserInfoToContext.php

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
use Magento\Authorization\Model\UserContextInterface;
1111
use Magento\GraphQl\Model\Query\ContextParametersInterface;
1212
use Magento\GraphQl\Model\Query\ContextParametersProcessorInterface;
13-
use Magento\Customer\Api\CustomerRepositoryInterface;
14-
use Magento\Customer\Api\Data\GroupInterface;
1513

1614
/**
1715
* @inheritdoc
@@ -23,21 +21,13 @@ class AddUserInfoToContext implements ContextParametersProcessorInterface
2321
*/
2422
private $userContext;
2523

26-
/**
27-
* @var CustomerRepositoryInterface
28-
*/
29-
private $customerRepository;
30-
3124
/**
3225
* @param UserContextInterface $userContext
33-
* @param CustomerRepositoryInterface $customerRepository
3426
*/
3527
public function __construct(
36-
UserContextInterface $userContext,
37-
CustomerRepositoryInterface $customerRepository
28+
UserContextInterface $userContext
3829
) {
3930
$this->userContext = $userContext;
40-
$this->customerRepository = $customerRepository;
4131
}
4232

4333
/**
@@ -58,15 +48,6 @@ public function execute(ContextParametersInterface $contextParameters): ContextP
5848
$contextParameters->setUserType($currentUserType);
5949

6050
$contextParameters->addExtensionAttribute('is_customer', $this->isCustomer($currentUserId, $currentUserType));
61-
62-
try {
63-
$customerGroupId = $this->customerRepository->getById($currentUserId)->getGroupId();
64-
} catch (\Exception $e) {
65-
$customerGroupId = GroupInterface::NOT_LOGGED_IN_ID;
66-
}
67-
68-
$contextParameters->addExtensionAttribute('customer_group_id', $customerGroupId);
69-
7051
return $contextParameters;
7152
}
7253

0 commit comments

Comments
 (0)