1

here is the adminhtml

<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <system>
                    <children>
                        <config>
                            <children>
                                <bannerslider module="bannerslider" translate="title">
                                    <title>Bannerslider</title>
                                    <sort_order>71</sort_order>                                 
                                </bannerslider>                             
                            </children>
                        </config>
                    </children>
                </system>
                <bannerslider module="bannerslider" translate="title">
                    <title>Bannerslider</title>
                    <sort_order>71</sort_order>               
                    <children>
                        <bannerslider module="bannerslider" translate="title">
                            <title>Manage Sliders</title>
                            <sort_order>0</sort_order>
                        </bannerslider>
                    <banner module="bannerslider" translate="title">
                        <title>Manage Banners</title>
                        <sort_order>2</sort_order>                          
                    </banner>
                        <standard_slider module="bannerslider" translate="title">
                            <title>Preview Slider Styles</title>
                            <sort_order>3</sort_order>                          
                        </standard_slider>
                        <banner_report module="bannerslider" translate="title">
                            <title>Report Banners</title>                   
                            <sort_order>4</sort_order>
                            <children>
                                <banner_report_all module="bannerslider" translate="title">
                                    <title>Per Slider</title>                                      
                                    <sort_order>1</sort_order>
                                </banner_report_all>
                                <banner_report_only module="bannerslider" translate="title">
                                    <title>All Sliders</title>                                        
                                    <sort_order>2</sort_order>
                                </banner_report_only>
                            </children>
                        </banner_report>
                        <settings module="bannerslider" translate="title">
                            <title>Settings</title>
                            <sort_order>1000</sort_order>
                        </settings>
                    </children>
                </bannerslider>
            </children>
        </admin>
    </resources>
</acl>

i assigned a role allow them to acccess "manage banner", but it shows access denied when the user access it via menu, anyone knows the problem?

When I comment out the following code in app\code\community\Magestore\Bannerslider\controllers\Adminhtml\BannerController.php it works:

/*protected function _isAllowed() {
    return Mage::getSingleton('admin/session')->isAllowed('banner');
}*/
  • 1
    Can you put full adminhtml.xml,config.xml and system.xml..it will be better to check – Amit Bera Jul 30 '14 at 5:43
2

change controller method

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

into

protected function _isAllowed() {
    return Mage::getSingleton('admin/session')->isAllowed('bannerslider');
}
  • 1
    or better: isAllowed('bannerslider/banner') – Fabian Schmengler Aug 28 '15 at 8:42
0

i think there is mistake in the your adminhtml.xml you need to define different tags for the both system->config options and for menu.

Try by replacing following code.

<acl>
    <resources>
        <all>
            <title>Allow Everything</title>
        </all>
        <admin>
            <children>
                <system>
                    <children>
                        <config>
                            <children>
                                <bannerslider module="bannerslider" translate="title">
                                    <title>Bannerslider</title>
                                    <sort_order>71</sort_order>                                 
                                </bannerslider>                             
                            </children>
                        </config>
                    </children>
                </system>
            </children>
            <children>
                <bannerslider module="bannerslider" translate="title">
                    <title>Bannerslider</title>
                    <sort_order>71</sort_order>               
                    <children>
                    <bannerslider module="bannerslider" translate="title">
                        <title>Manage Sliders</title>
                        <sort_order>0</sort_order>
                    </bannerslider>
                    <banner module="bannerslider" translate="title">
                        <title>Manage Banners</title>
                        <sort_order>2</sort_order>                          
                    </banner>
                        <standard_slider module="bannerslider" translate="title">
                            <title>Preview Slider Styles</title>
                            <sort_order>3</sort_order>                          
                        </standard_slider>
                        <banner_report module="bannerslider" translate="title">
                            <title>Report Banners</title>                   
                            <sort_order>4</sort_order>
                            <children>
                                <banner_report_all module="bannerslider" translate="title">
                                    <title>Per Slider</title>                                      
                                    <sort_order>1</sort_order>
                                </banner_report_all>
                                <banner_report_only module="bannerslider" translate="title">
                                    <title>All Sliders</title>                                        
                                    <sort_order>2</sort_order>
                                </banner_report_only>
                            </children>
                        </banner_report>
                        <settings module="bannerslider" translate="title">
                            <title>Settings</title>
                            <sort_order>1000</sort_order>
                        </settings>
                    </children>
                </bannerslider>
            </children>
        </admin>
    </resources>
</acl>

Don't Forget to cleare the cache.

  • That's not true. system and bannerslider belong into the same children element. – Fabian Schmengler Aug 28 '15 at 8:45
-1

app\code\community\Magestore\Bannerslider\controllers\Adminhtml\BannerController.php

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

fixed by comment out the above code.

  • This does not answer what is wrong with the configuration. I added the information to the question. – Fabian Schmengler Aug 28 '15 at 8:39
  • This is already the solution for the module's bug – hkguile Aug 29 '15 at 4:19
  • It's band aid. Only works if you did not apply the SUPEE-6285 security patch and until then allows access to every admin user – Fabian Schmengler Aug 29 '15 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.