Magento 1.9 – How to Give Custom Access Permissions for Admin Users to an Extension

aclextensionsmagento-1.9permissionsuser-roles

I have created a admin user in magento and give certain access permissions, and i have an extension called support ticket, i gave user role access to this extension, when i logged in that particular user i am getting an error called access denied for that support ticket extension, when i login as admin it is working fine, and when i changed user role permission from custom to all, every thing is working as expected, but i need to give only this particular access permission,what can i do ?enter image description here

adminhtml.xml

<?xml version="1.0"?>
<config>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <support_ticket_ultimate translate="title" module="supportticket">
                                        <title>Support Ticket Ultimate Section</title>
                                        <sort_order>0</sort_order>
                                    </support_ticket_ultimate>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

Best Answer

I want to explain a bit what @Sander Mangel said in his answer:

  • make sure the Adminhtml controller of the module has a _isAllowed method

Look for files like this:

/app/code/community/your/module/controllers/Adminhtml/SomeController.php

and make sure there's a method that looks like this inside every admin controller:

protected function _isAllowed()
{
    return Mage::getSingleton('admin/session')->isAllowed('your_module/resource_you_need');
}

A recent security patch makes it so that controllers without the _isAllowed method do not work. That answer also says that this works if the module has implemented ACL in etc/adminhtml.xml and since you say you added the appropiate permission to the user role, it sounds like yours does. In case it doesn't, just return true; from the method, but this allows access to any admin user.

Related Topic