2

カスタム モジュールを作成しました。私の config.xml は次のとおりです…

<?xml version="1.0"?>
  <config>
   <admin>
    <routers>
        <blacklist>
            <use>admin</use>
            <args>
                <module>Leon_Blacklist</module>
                <frontName>blacklist</frontName>
            </args>
        </blacklist>
    </routers>
</admin>
<adminhtml>
    <menu>
        <blacklist translate="title" module="blacklist">
            <title>Blacklist</title>
            <sort_order>71</sort_order>               
            <children>
                <items translate="title" module="blacklist">
                    <title>Manage Items</title>
                    <sort_order>0</sort_order>
                    <action>blacklist/adminhtml_blacklist</action>
                </items>
            </children>
        </blacklist>
    </menu>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <Leon_Blacklist translate="title" module="blacklist">
                        <title>Blacklist Module</title>
                        <sort_order>10</sort_order>

                        <children>
                            <items translate="title" module="blacklist">
                                <title>Manage Items</title>
                            </items>                        
                        </children>
                    </Leon_Blacklist>
                </children>
            </admin>
        </resources>
    </acl>
    <layout>
        <updates>
            <blacklist>
                <file>blacklist.xml</file>
            </blacklist>
        </updates>
    </layout>
</adminhtml> 
<config>

管理者アカウントがログインしている場合、モジュールは期待どおりに機能します。モジュールは管理者パネルとロール リソース タブ ([システム] -> [権限] -> [ロール]) に表示されますが、モジュールを確認してユーザーを保存しようとすると、保存されたと表示されます。しかし、ユーザーの役割を再確認したところ、まだチェックされていません。

そして、上記のユーザーロールを持つアカウントを使用してログインしようとすると、カスタムモジュールが非表示になります。問題に見えるのは?どんな種類の助けも大歓迎です..

ありがとう。

4

2 に答える 2

5

config の acl セクションが少し間違っています。タグはメニュー セクションに似ている必要があります。したがって、あなたの場合、次のようになります。

<acl>
    <resources>
        <admin>
            <children>
                <blacklist translate="title" module="blacklist">
                    <title>Blacklist Module</title>
                    <sort_order>10</sort_order>

                    <children>
                        <items translate="title" module="blacklist">
                            <title>Manage Items</title>
                        </items>                        
                    </children>
                </blacklist>
            </children>
        </admin>
    </resources>
</acl>
于 2013-05-02T13:19:08.417 に答える