tags:

views:

196

answers:

3

Here's the situation:

I would like to add a Menu in the Magento backend navigation menu.
I accomplished this by adding the following code in 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> 

The problem is I can't include this menu in the permission->role resources so I can't assign this to a specific user.

How do I include this menu in the permission->role resources?

Thank you and more power!

+3  A: 

You need to tell magento that you want your new menu position to be visible in the permission tree. To do this you have to add an ACL section to your configuration data. Put this inside your module's config.xml file:

     <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>
silvo
+1  A: 

thanks.. I got it to work with a few tweakings..

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

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

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

this will displaythe following menu with sub menus in the backend.. plus this can be configured in the role resources.. :)

will post the image soon.. need to have 10 points :(

alt text

Christian Young
A: 

Excellent note.helped a lot

Suman Kar