【问题标题】:Magento Admin Menu AclMagento 管理员菜单 Acl
【发布时间】:2016-10-20 09:49:19
【问题描述】:

代码在后端添加了一个新菜单。但是我在新页面上有一个权限被拒绝的问题。我添加了控制器和助手。

我的 adminhtml.xml

    <config>
<menu>
    <mycustomtab module="colorswitch" translate="title">
        <title>My Custom Tab</title>
        <sort_order>100</sort_order>
        <children>
            <index module="colorswitch" translate="title">
                <title>Index Action</title>
                <sort_order>1</sort_order>
                <action>adminhtml/colorswitch</action>
            </index>
            <list module="colorswitch" translate="title">
                <title>List Action</title>
                <sort_order>2</sort_order>
                <action>adminhtml/custom/list</action>
            </list>
        </children>
    </mycustomtab>
</menu>
<acl>
    <resources>
        <admin>
            <children>
                <custom translate="title" module="colorswitch">
                    <title>My Controller</title>
                    <sort_order>-100</sort_order>
                    <children>
                        <index translate="title">
                            <title>Index Action</title>
                            <sort_order>1</sort_order>
                        </index>
                        <list translate="title">
                            <title>List Action</title>
                            <sort_order>2</sort_order>
                        </list>
                    </children>
                </custom>
            </children>
        </admin>
    </resources>
</acl>

我不知道,问题出在哪里。

【问题讨论】:

  • 请检查我的答案。

标签: magento menu acl


【解决方案1】:

在菜单中你使用过节点

 <config>
  <menu>
    <mycustomtab module="colorswitch" translate="title">

及以下

   <acl>
    <resources>
        <admin>
            <children>
                <**custom** translate="title" module="colorswitch">

将此自定义节点更改为 mycustomtab

【讨论】:

    【解决方案2】:

    你的代码:

    <acl>
        <resources>
        <admin>
            <children>
                <custom translate="title" module="colorswitch">
                    <title>My Controller</title>
                    <sort_order>-100</sort_order>
                    <children>
                        <index translate="title">
                            <title>Index Action</title>
                            <sort_order>1</sort_order>
                        </index>
                        <list translate="title">
                            <title>List Action</title>
                            <sort_order>2</sort_order>
                        </list>
                    </children>
                </custom>
            </children>
        </admin>
        </resources>
    </acl>
    

    应该是:

    <acl>
        <resources>
        <admin>
            <children>
                <mycustomtab translate="title" module="colorswitch">
                    <title>My Controller</title>
                    <sort_order>-100</sort_order>
                    <children>
                        <index translate="title">
                            <title>Index Action</title>
                            <sort_order>1</sort_order>
                        </index>
                        <list translate="title">
                            <title>List Action</title>
                            <sort_order>2</sort_order>
                        </list>
                    </children>
                </mycustomtab>
            </children>
        </admin>
        </resources>
    </acl>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-17
      • 2015-02-07
      • 1970-01-01
      • 2013-04-30
      • 1970-01-01
      相关资源
      最近更新 更多