2010-08-10 46 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> 
相關問題