tags:

views:

77

answers:

2

I have created a few custom modules for Magento and when I try to assign permissions to the module (check the checkbox) when I click save it unchecks the box.

Anyone have any ideas? It sort of sounds like there is something off in my config.xml file so I will post it here just in case:

<config>
<modules>
    <Wpe_Vendorlist>
        <version>0.1.0</version>
    </Wpe_Vendorlist>
</modules>
<admin>
    <routers>
        <vendorlist>
            <use>admin</use>
            <args>
                <module>Wpe_Vendorlist</module>
                <frontName>vendorlist</frontName>
            </args>
        </vendorlist>
    </routers>
</admin>
<adminhtml>
    <menu>
        <customer>
            <children>
                <items module="vendorlist">
                    <title>SO Vendor List</title>
                    <sort_order>999</sort_order>
                    <action>vendorlist/adminhtml_vendorlist</action>
                </items>
            </children>
        </customer>
    </menu>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <Wpe_Vendorlist>
                        <title>Vendorlist Module</title>
                        <sort_order>10</sort_order>
                    </Wpe_Vendorlist>
                </children>
            </admin>
        </resources>
    </acl>
    <layout>
        <updates>
            <vendorlist>
                <file>vendorlist.xml</file>
            </vendorlist>
        </updates>
    </layout>
</adminhtml>
<global>
    <models>
        <vendorlist>
            <class>Wpe_Vendorlist_Model</class>
            <resourceModel>vendorlist_mysql4</resourceModel>
        </vendorlist>
        <vendorlist_mysql4>
            <class>Wpe_Vendorlist_Model_Mysql4</class>
            <entities>
                <vendorlist>
                    <table>vendorlist</table>
                </vendorlist>
            </entities>
        </vendorlist_mysql4>
    </models>
    <resources>
        <vendorlist_setup>
            <setup>
                <module>Wpe_Vendorlist</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </vendorlist_setup>
        <vendorlist_write>
            <connection>
                <use>core_write</use>
            </connection>
        </vendorlist_write>
        <vendorlist_read>
            <connection>
                <use>core_read</use>
            </connection>
        </vendorlist_read>
    </resources>
    <blocks>
        <vendorlist>
            <class>Wpe_Vendorlist_Block</class>
        </vendorlist>
    </blocks>
    <helpers>
        <vendorlist>
            <class>Wpe_Vendorlist_Helper</class>
        </vendorlist>
    </helpers>
</global>

Thanks!

A: 

I found something from magento forum. Go to the following link: http://www.magentocommerce.com/boards/viewthread/78673/

But still can't set permission to these custom modules from newly created roles. These custom modules didn't appear in main menu for that newly created roles' users.

white spot
A: 

hi josh,
I strongly recomend you to take a look at Alan Storm's article about system configuration, and the rest of his serie, it's the best info I've found about magento programing.

For this particular question, here is how I've done it in my module, with your module name:

<acl><!-- permits -->
    <resources>
        <admin>
            <children>
                <customer translate="title" module="vendorlist"><!-- this tag matches the menu tag, and the same for his children -->
                    <title>what will appears in the checkboxes tree when you create a role</title>
                    <children>
                        <firstchild>
                            <title>what will appears in the checkboxes tree when you create a role</title>
                        </firstchild>
                    </children>
                </customer>
            </children>
        </admin>
    </resources>
</acl>

You won't need the:

                <children>
                    <firstchild>
                        <title>what will appears in the checkboxes tree when you create a role</title>
                    </firstchild>
                </children>

as you don't have children in your module, it seems, I just put it as an example.
I hope this helps

david parloir