将配置保存为非管理员用户时,Magento 付款方式访问被拒绝
Magento Payment Methods Access Denied when Saving Configuration as non admin user
我认为核心 Mage_Paypal 模块在 adminhtml.xml 中的 ACL 代码方面存在错误。
在 app/core/Mage/Adminhtml/Model/Config/Data.php 的第 170 行,路径 'paypal/general/merchant_country' 似乎不是不允许的:
if (!Mage::getSingleton('admin/session')->isAllowed($configPath)) {
Mage::throwException('Access denied.');
}
adminhtml.xml 文件是这样的:
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<paypal>
<title>PayPal Section</title>
</paypal>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
在 system.xml 中,我找不到任何可以保存配置值的 paypal 部分,只有一个字段 'payment/account/merchant_country' 有一个 config_path 标签,值为 'paypal/general/merchant_country' .
这不是 Mage_Paypal,这是 Mage_Adminhtml。问题是 config_path
.
的检查
一个解决方案,我不是 100% 确定,在 Mage_Adminhtml_Model_Config_Data
中,替换第 175 行:
if (!Mage::getSingleton('admin/session')->isAllowed($configPath)) {
作者:
if (!Mage::getSingleton('admin/session')->isAllowed('system/config/'.substr($configPath, 0, strpos($configPath, '/')))) {
(使用 Magento 1.9.4.3 测试)
我认为核心 Mage_Paypal 模块在 adminhtml.xml 中的 ACL 代码方面存在错误。
在 app/core/Mage/Adminhtml/Model/Config/Data.php 的第 170 行,路径 'paypal/general/merchant_country' 似乎不是不允许的:
if (!Mage::getSingleton('admin/session')->isAllowed($configPath)) {
Mage::throwException('Access denied.');
}
adminhtml.xml 文件是这样的:
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<paypal>
<title>PayPal Section</title>
</paypal>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
在 system.xml 中,我找不到任何可以保存配置值的 paypal 部分,只有一个字段 'payment/account/merchant_country' 有一个 config_path 标签,值为 'paypal/general/merchant_country' .
这不是 Mage_Paypal,这是 Mage_Adminhtml。问题是 config_path
.
一个解决方案,我不是 100% 确定,在 Mage_Adminhtml_Model_Config_Data
中,替换第 175 行:
if (!Mage::getSingleton('admin/session')->isAllowed($configPath)) {
作者:
if (!Mage::getSingleton('admin/session')->isAllowed('system/config/'.substr($configPath, 0, strpos($configPath, '/')))) {
(使用 Magento 1.9.4.3 测试)