we have mageworx files download which can be accessed by only adminstrator role and when we create new roles and assign the resource to the role it does not work, the problem is that the _isAllowed does not exist in the controller:
here is the controller and I added the isAllowed inside, I do not want to return true because if I do so, still someone that don't have access can access the module:
class MageWorx_Adminhtml_Adminhtml_Mageworx_FilesController extends Mage_Adminhtml_Controller_Action
{
protected function _isAllowed() {
return Mage::getSingleton('admin/session')->isAllowed('cms/downloads/files/mageworx_files');
}
}
here is the part of config.xml that is related to the module:
<adminhtml>
<menu>
<cms>
<children>
<downloads translate="title" module="downloads">
<title>File Downloads</title>
<depends>
<config>mageworx_cms/downloads/enabled</config>
</depends>
<children>
<files translate="title" module="downloads">
<title>Manage Files</title>
<sort_order>0</sort_order>
<action>adminhtml/mageworx_files/</action>
</files>
<categories translate="title" module="downloads">
<title>Manage Categories</title>
<sort_order>1</sort_order>
<action>adminhtml/mageworx_categories/</action>
</categories>
<configuration translate="title" module="downloads">
<title>Configuration</title>
<sort_order>2</sort_order>
<action>adminhtml/system_config/edit/section/mageworx_cms/</action>
</configuration>
</children>
</downloads>
</children>
</cms>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<mageworx_cms translate="title" module="downloads">
<title>MageWorx > CMS</title>
<sort_order>1</sort_order>
<children>
<downloads translate="title" module="downloads">
<title><![CDATA[File Downloads & Product Attachments]]></title>
</downloads>
</children>
</mageworx_cms>
</children>
</config>
</children>
</system>
<cms>
<children>
<downloads translate="title" module="downloads">
<title>File Downloads</title>
<sort_order>100</sort_order>
<children>
<files translate="title">
<title>Manage Files</title>
<sort_order>0</sort_order>
</files>
<categories translate="title">
<title>Manage Categories</title>
<sort_order>1</sort_order>
</categories>
<configuration translate="title">
<title>Configuration</title>
<sort_order>2</sort_order>
</configuration>
</children>
</downloads>
</children>
</cms>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<downloads>
<file>downloads.xml</file>
</downloads>
</updates>
</layout>
<events>
<catalog_product_save_after>
<observers>
<downloads>
<type>singleton</type>
<class>MageWorx_Downloads_Model_Observer</class>
<method>saveProductFiles</method>
</downloads>
</observers>
</catalog_product_save_after>
</events>
</adminhtml>
I don't know why my isAllowed function is wrong, how can I correct it? and here is the part of url that we can see the module:
index.php/admin/mageworx_files/index/key/xxxxx