How to add acl in custom module in magento
A general explanation:
ACL for admin menu
To define the ACL for a custom admin menu entry, copy everything below adminhtml/menu
to acl/resources/admin/children
and remove the <action>
nodes.
Example: What to copy
To actually use the ACL you have to add the following method to your controller:
protected function _isAllowed()
{
return Mage::getSingleton('admin/session')->isAllowed('ENTER RESOURCE IDENTIFIER HERE');
}
The resource identifier is base on the node names below acl/resources/admin/children
, skipping following children
nodes.
Example: Resource identifiers
ACL for system configuration section
To define the ACL for a system configuration section, the following has to be added below acl/resources/admin/children
:
<system>
<children>
<config>
<children>
<my_configuration_section>
<title>My Configuration Section</title>
</my_configuration_section>
</children>
</config>
</children>
</system>
where my_configuration_section
is coming from system.xml
:
<sections>
<my_configuration_section translate="label" module="my_module">
...
</my_configuration_section>
</sections>
Specific to your question:
In your case, that means, adminhtml.xml
should look like this:
<?xml version="1.0" encoding="UTF-8" ?>
<config>
<acl>
<resources>
<admin>
<children>
<customer translate="title" module="adminhtml">
<sort_order>100</sort_order>
<children>
<set_time>
<title>Seller List</title>
</set_time>
</children>
</customer>
</children>
</admin>
</resources>
</acl>
</config>
Create adminhtml.xml
at Webcreon/Seller/etc
where you need put your code
<?xml version="1.0" encoding="UTF-8" ?>
<config>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<customer translate="title" module="seller">
<children>
<set_time translate="title">
<title>Seller List</title>
</set_time>
</children>
</customer>
</children>
</admin>
</resources>
</acl>
</config>
Accoring to you have create new menu at customer section
a child tab
and it name is set_time
So i am add this code
<customer translate="title" module="seller">
<children>
<set_time translate="title">
<title>Seller List</title>
</set_time>
</children>
</customer>