Config ACL Definition

Posted Almost 12 years ago. Visible to the public.

This should go in adminhtml.xml. Also see Config Menu Definition (note that the XML path of the menu entry needs to match up with the XML path of the ACL entry). To see how to implement the checking of an ACL within an admin controller see the _isAllowed() method in Boilerplate Admin Controller.

To place an entry under the sales node (alter the name for other nodes):

<adminhtml>
    <acl>
        <resources>
            <admin>
                <children>
                    <sales>
                        <children>
                            <namespace_module translate="title" module="namespace_module">
                                <title>Your Module</title>
                                <sort_order>100</sort_order>
                                <!-- Children are optional -->
                                <children>
                                    <this translate="title" module="namespace_module">
                                        <title>This</title>
                                        <sort_order>10</sort_order>
                                    </this>
                                    <that translate="title" module="namespace_module">
                                        <title>That</title>
                                        <sort_order>20</sort_order>
                                    </that>
                                </children>
                            </namespace_module>
                        </children>
                    </sales>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>

To place an entry on the top bar itself:

<adminhtml>
    <acl>
        <resources>
            <admin>
                <children>
                    <namespace_module translate="title" module="namespace_module">
                        <title>Your Module</title>
                        <sort_order>100</sort_order>
                        <!-- Children are optional -->
                        <children>
                            <this translate="title" module="namespace_module">
                                <title>This</title>
                                <sort_order>10</sort_order>
                            </this>
                            <that translate="title" module="namespace_module">
                                <title>That</title>
                                <sort_order>20</sort_order>
                            </that>
                        </children>
                   </namespace_module>
               </children>
           </admin>
       </resources>
    </acl>
</adminhtml>

Mike Whitby
Last edit
Over 7 years ago
Mike Whitby
Posted by Mike Whitby to Magento (2012-05-01 09:58)