2010-08-10 82 views
4

这里的情况:如何Magento管理菜单链接到角色的资源

我想在Magento的后端导航菜单中添加一个菜单。
app/etc/config.xml做到了这一点通过添加以下代码:

<adminhtml> 
<menu> 
    <example translate="title" module="adminhtml"> 
     <title>Inventory</title> 
     <sort_order>110</sort_order> 
     <children> 
      <set_time> 
       <title>Set It!</title> 
       <action>helloworld/index/goodbye</action> 
      </set_time> 
     </children> 
    </example> 
</menu> 

问题是我不能包括在permission-此菜单>角色的资源,所以我不能这样分配给特定用户。

如何将此菜单包含在权限 - >角色资源中?

谢谢你,更多的权力!

回答

1

感谢..我得到了它与几个tweakings工作..

<adminhtml> 
    <acl> 
     <resources> 
      <admin> 
       <children> 

<helloworld_options translate="label" module="helloworld"> 
    <title> MENU</title> 
        <sort_order>999</sort_order> 
        <children> 
    <hello_children1> 
    <title> RELATION</title> 
          <sort_order>10</sort_order> 
    </hello_children1> 
    <hello_children2> 
    <title> MACHINE</title> 
          <sort_order>20</sort_order> 
    </hello_children2> 
    <hello_children3> 
    <title> INVOICE</title> 
          <sort_order>30</sort_order> 
    </hello_children3> 
    </children> 
</helloworld_options> 

        <system> 
         <children> 
          <config> 
           <children> 
            <helloworld_options translate="label" module="helloworld"> 
             <title> MENU</title> 
            </helloworld_options> 
           </children> 
          </config> 
         </children> 
        </system> 
       </children> 
      </admin> 
     </resources> 
    </acl> 
</adminhtml> 

这将显示在后台子菜单下面的菜单..加上这个可以在角色资源中配置.. :)

5

您需要告诉magento您希望您的新菜单位置在权限树中可见。为此,您必须在配置数据中添加ACL部分。将这个你的模块的config.xml文件中:

 <acl> 
     <resources> 
      <admin> 
       <children> 
        <example> 
          <title>Inventory</title> 
          <sort_order>110</sort_order> 
          <children> 
           <set_time> 
            <title>Set It!</title> 
            <sort_order>0</sort_order> 
           </set_time> 
          </children> 
        </example> 
       </children> 
      </admin> 
     </resources> 
    </acl> 
相关问题