Magento – Magenot2: what is the use of `resource` paramerter in menu.xml

magento2magento2-dev-beta

i created one testing module in magento2 and for backend added menu by this code:

location of this file is Test/Seller/etc/adminhtml/menu.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd">
<menu>
<add id="Test_Seller::seller" title="Seller" module="Test_Seller" sortOrder="40" resource="Test_Seller::seller"/>
    <add id="Test_Seller::items" title="Manage Sellers" module="Test_Seller" sortOrder="40" parent="Test_Seller::seller" action="selleradmin/manage/" resource="Test_Seller::items"/>
</menu>
</config>

its working fine. all parameters are clear but what is ther use of resource parameter in add node.
if i remove this parameter then "Missing required param resource" error is coming.

Best Answer

Resource attribute define acl resource for menu element. If user has not access to this resource then the menu item will be not shown for him.