Magento Forum

ACL error (config.xml) in admin module kills complete custom “Role Resources”
 
Bjoern Ellebrecht
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2008-05-08
Hamburg (Norderstedt)
 

Hello,

I try to implement a simple admin module from wiki http://www.magentocommerce.com/wiki/how_to_create_an_admin_form_module but if I go to:

System -> Persissions -> Roles

and add a new role there are no custom role resources shown. If I delete ACL in config.xml, role resources are shown and everything works fine.  confused
Even if I copy ACL part from other admin module like ”GoogleAnalytics” it does not work. Pleasy see attachment image for further information.

Module:

app/code/local/Aha/AuctionGuard

Here is my (app/code/local/Aha/AuctionGuard/etc/)config.xml:

<?xml version="1.0"?>
<config>

    <!-- 
Module Version -->
    <
modules>
        <
Aha_AuctionGuard>
            <
version>0.1.0</version>
        </
Aha_AuctionGuard>
    </
modules>

    <!-- Global 
Ressourcen -->
    <global>
        <
helpers>
            <
auctionguard>
                <class>
Aha_AuctionGuard_Helper</class>
            </
auctionguard>
        </
helpers>
        <
blocks>
            <
auctionguard>
                <class>
Aha_AuctionGuard_Block</class>
            </
auctionguard>
        </
blocks>
    </global>

    <!-- 
Routes -->
    <
admin>
        <
routers>
            <
auctionguard>
                <use>
admin</use>
                <
args>
                    <
module>Aha_AuctionGuard</module>
                    <
frontName>auctionguard</frontName>
                </
args>
            </
auctionguard>
        </
routers>
    </
admin>


    <
adminhtml>

        <
menu>
            <
base>
                <
children>
                    <
auctionguard module="auctionguard">
                        <
title>AuctionGuard</title>
                        <
action>auctionguard/adminhtml_dashboard</action>
                    </
auctionguard>
                </
children>
           </
base>
        </
menu>
        
        <
acl>
            <
resources>
                <
admin>
                    <
children>
                        <
system>
                            <
children>
                                <
config>
                                    <
children>
                                        <
auctionguard>
                                            <
title>AuctionGuard</title>
                                        </
auctionguard>
                                    </
children>
                                </
config>
                            </
children>
                        </
system>
                    </
children>
                </
admin>
            </
resources>
        </
acl>

        <
layout>
            <
updates>
                <
auctionguard>
                    <
file>auctionguard.xml</file>
                </
auctionguard>
            </
updates>
        </
layout>

    </
adminhtml>

    <default>
        <
auctionguard>
            <
auctionguard>
                <
enabled>1</enabled>
            </
auctionguard>
        </
auctionguard>
    </default>

</
config>

What is my error in reasoning? question  Where can I find detailed information about acl in magento?  grin

Greetings
Björn

Image Attachments
role_resources_lost.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
Bjoern Ellebrecht
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2008-05-08
Hamburg (Norderstedt)
 

Hello all,

I have found a “work-a-round” for the ACL error. It is very simple, but I think not the right way…
...anyway, here is my solution…

Add to one custom module in the config.xml following code:

<?xml version="1.0"?>
<config>

    <!-- 
other stuff -->

    <
adminhtml>
        
        <
acl>
            <
resources>
                <!-- 
needed herebecause otherwise Tree will not been displayed -->
                <!-- 
ACL error Solution START -->
                <
all>
                    <
title>Allow everything</title>
                </
all>
                <!-- 
ACL error Solution END -->

                <
admin>
                    <
children>
                        <
your_module>
                            <
title>your_title</title>
                            <
sort_order>123</sort_order>
                        </
your_module>
                    </
children>
                </
admin>
            </
resources>
        </
acl>

    </
adminhtml>

</
config>

The important XML code is, that you have to add the “all” section copied from:

app/code/core/Mage/Adminhtml/etc/config.xml
I have found out, that the “all” section have to be first, otherwise it will be added last and ACL tree is lost.

I neither know if this is a bug nor if there is a better way to solve this error.

Beste greeting
Björn

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive_br
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

I’ll try this way, and I can see, into the permissions list, my module.
The problem is that I assign this module to the role, but this role still hidden for that role.
Do you get any solution?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Georges@Bitbol
Sr. Member
 
Avatar
Total Posts:  104
Joined:  2008-08-07
Paris, France
 

I have the same issue.

Role in admin is displayed. but the page are nto allowed.
Did you find the clue ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive_br
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

Sorry, I didn’t post the solution.
I made my own modules and use the security layer of Magento.
The second post works, but you need to take care about the module name.
Look into the admin / children node.
In the above example says <your_module>. Try to change it to <yourmodule> or something like that.
Magento use the underscore to separte directories.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top