2016-10-20 1 views
0

Le code ajoute un nouveau menu dans le backend. Mais j'ai un problème de permission refusé sur la nouvelle page. J'ajoute le contrôleur et l'assistant.Magento Admin Menu Acl

Mon adminhtml.xml

<config> 
<menu> 
    <mycustomtab module="colorswitch" translate="title"> 
     <title>My Custom Tab</title> 
     <sort_order>100</sort_order> 
     <children> 
      <index module="colorswitch" translate="title"> 
       <title>Index Action</title> 
       <sort_order>1</sort_order> 
       <action>adminhtml/colorswitch</action> 
      </index> 
      <list module="colorswitch" translate="title"> 
       <title>List Action</title> 
       <sort_order>2</sort_order> 
       <action>adminhtml/custom/list</action> 
      </list> 
     </children> 
    </mycustomtab> 
</menu> 
<acl> 
    <resources> 
     <admin> 
      <children> 
       <custom translate="title" module="colorswitch"> 
        <title>My Controller</title> 
        <sort_order>-100</sort_order> 
        <children> 
         <index translate="title"> 
          <title>Index Action</title> 
          <sort_order>1</sort_order> 
         </index> 
         <list translate="title"> 
          <title>List Action</title> 
          <sort_order>2</sort_order> 
         </list> 
        </children> 
       </custom> 
      </children> 
     </admin> 
    </resources> 
</acl> 

Je nai aucune idée où est le problème.

+0

pls vérifier ma réponse. –

Répondre

0

Dans le menu vous HVE noeud utilisé

<config> 
    <menu> 
    <mycustomtab module="colorswitch" translate="title"> 

et au-dessous

<acl> 
    <resources> 
     <admin> 
      <children> 
       <**custom** translate="title" module="colorswitch"> 

Modifier cette noeud personnalisé à mycustomtab

+0

est-ce que cela a fonctionné pour vous? – Shrikant

0

Votre code:

<acl> 
    <resources> 
    <admin> 
     <children> 
      <custom translate="title" module="colorswitch"> 
       <title>My Controller</title> 
       <sort_order>-100</sort_order> 
       <children> 
        <index translate="title"> 
         <title>Index Action</title> 
         <sort_order>1</sort_order> 
        </index> 
        <list translate="title"> 
         <title>List Action</title> 
         <sort_order>2</sort_order> 
        </list> 
       </children> 
      </custom> 
     </children> 
    </admin> 
    </resources> 
</acl> 

devrait être:

<acl> 
    <resources> 
    <admin> 
     <children> 
      <mycustomtab translate="title" module="colorswitch"> 
       <title>My Controller</title> 
       <sort_order>-100</sort_order> 
       <children> 
        <index translate="title"> 
         <title>Index Action</title> 
         <sort_order>1</sort_order> 
        </index> 
        <list translate="title"> 
         <title>List Action</title> 
         <sort_order>2</sort_order> 
        </list> 
       </children> 
      </mycustomtab> 
     </children> 
    </admin> 
    </resources> 
</acl>