Skip to content

Commit ce27720

Browse files
committed
Merge remote-tracking branch 'origin/magento2-login-as-customer#150V3' into login-as-customer-150
# Conflicts: # app/code/Magento/LoginAsCustomerAssistance/composer.json
2 parents cde0ebb + 5e3bdd6 commit ce27720

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

app/code/Magento/LoginAsCustomerAssistance/Model/Config.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use Magento\Framework\App\Config\ScopeConfigInterface;
1111
use Magento\LoginAsCustomerAssistance\Api\ConfigInterface;
12+
use Magento\Store\Model\ScopeInterface;
1213

1314
/**
1415
* @inheritdoc
@@ -42,14 +43,20 @@ public function __construct(
4243
*/
4344
public function getShoppingAssistanceCheckboxTitle(): string
4445
{
45-
return (string)$this->scopeConfig->getValue(self::XML_PATH_SHOPPING_ASSISTANCE_CHECKBOX_TITLE);
46+
return (string)$this->scopeConfig->getValue(
47+
self::XML_PATH_SHOPPING_ASSISTANCE_CHECKBOX_TITLE,
48+
ScopeInterface::SCOPE_WEBSITE
49+
);
4650
}
4751

4852
/**
4953
* @inheritdoc
5054
*/
5155
public function getShoppingAssistanceCheckboxTooltip(): string
5256
{
53-
return (string)$this->scopeConfig->getValue(self::XML_PATH_SHOPPING_ASSISTANCE_CHECKBOX_TOOLTIP);
57+
return (string)$this->scopeConfig->getValue(
58+
self::XML_PATH_SHOPPING_ASSISTANCE_CHECKBOX_TOOLTIP,
59+
ScopeInterface::SCOPE_WEBSITE
60+
);
5461
}
5562
}

app/code/Magento/LoginAsCustomerAssistance/Plugin/CustomerDataValidatePlugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public function beforeExtractData(
5757
$scope = null,
5858
$scopeOnly = true
5959
): void {
60-
if (!$this->authorization->isAllowed('Magento_LoginAsCustomer::opt_in_preference')
61-
&& $this->isSetAssistanceAllowedParam($request)
60+
if ($this->isSetAssistanceAllowedParam($request)
61+
&& !$this->authorization->isAllowed('Magento_LoginAsCustomer::allow_shopping_assistance')
6262
) {
6363
$customerId = $request->getParam('customer_id');
6464
$assistanceAllowedParam =

app/code/Magento/LoginAsCustomerAssistance/Plugin/DataProviderWithDefaultAddressesPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function afterGetMeta(
8989
): array {
9090
if (!$this->config->isEnabled()) {
9191
$assistanceAllowedConfig = ['visible' => false];
92-
} elseif (!$this->authorization->isAllowed('Magento_LoginAsCustomer::opt_in_preference')) {
92+
} elseif (!$this->authorization->isAllowed('Magento_LoginAsCustomer::allow_shopping_assistance')) {
9393
$assistanceAllowedConfig = [
9494
'disabled' => true,
9595
'notice' => __('You have no permission to change Opt-In preference.'),

app/code/Magento/LoginAsCustomerAssistance/composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
"magento/framework": "*",
77
"magento/module-backend": "*",
88
"magento/module-customer": "*",
9+
"magento/module-store": "*",
10+
"magento/module-login-as-customer": "*",
911
"magento/module-login-as-customer-api": "*"
1012
},
1113
"suggest": {
12-
"magento/module-login-as-customer-admin-ui": "*",
13-
"magento/module-login-as-customer": "*"
14+
"magento/module-login-as-customer-admin-ui": "*"
1415
},
1516
"type": "magento2-module",
1617
"license": [

app/code/Magento/LoginAsCustomerAssistance/etc/acl.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<resource id="Magento_Backend::admin">
1212
<resource id="Magento_Customer::customer">
1313
<resource id="Magento_LoginAsCustomer::login">
14-
<resource id="Magento_LoginAsCustomer::opt_in_preference" title="Change Customer Opt-In Preference" sortOrder="20" />
14+
<resource id="Magento_LoginAsCustomer::allow_shopping_assistance" title="Allow remote shopping assistance" sortOrder="20" />
1515
</resource>
1616
</resource>
1717
</resource>

0 commit comments

Comments
 (0)