Magento付款方式以非管理员用户身份保存配置时拒绝访问

时间:2018-05-07 13:28:16

标签: php xml magento paypal

我认为核心Mage_Paypal模块在adminhtml.xml中有关于ACL代码的错误。

在第170行的app / core / Mage / Adminhtml / Model / Config / Data.php中,路径为“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部分,只有一个字段&#39; payment / account / merchant_country&#39;它的config_path标记值为&#39; paypal / general / merchant_country&#39;。

1 个答案:

答案 0 :(得分:0)

这不是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测试)

相关问题