dongwu8653 2018-03-05 13:04
浏览 108

自定义模块仅允许Magento 1.9中的完全管理员权限

I have created a custom module in Magento 1.9 and I want to access that module only if I'm logged in on a full admin account, but I want this to be default. If I'm logged in with another role, I don't want to have access at this module at all. And when I create a new user role, I don't want to have any option at Role Resources because I don't want any of my admin users to give permission by mistake to any other role users. Is this possible?

Shortly: This module can be access only if I am logged in on a full admin user and I don't want any checkbox option on role resources because any other role cannot access the module. This module is only for admin panel.

If I don't add the acl tag in adminhtml.xml, I get a 404 Error on System->Configuration on module section.

This is my acl tag:

<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <system>
                    <children>
                        <config>
                            <children>
                                <namespace_modulename translate="title" module="namespace_modulename">
                                    <title>module-title</title>
                                </namespace_modulename>
                            </children>
                        </config>
                    </children>
                </system>
            </children>
        </admin>
    </resources>
</acl>

Can anyone help me with that? I'm not sure if the acl is correctly created.

  • 写回答

1条回答 默认 最新

  • dpdjv9559 2018-03-05 13:11
    关注

    The only option I see would be to alter the content of the isAllowed method in your controller.
    There you can check if the id or name of the current user group is the one from the admin group.
    This will prevent any other group to access the page. But it will still be visible in the menu if the checkbox in the acl is checked.

    评论

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后的密码
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面