2016-12-08 3 views
3

私は、Magentoの2管理者のカスタムモジュールリストの単純なグリッドを持っているが、私は、デフォルト、他のユーザーにadminとそれにアクセスすることはできませんMagentoの2カスタムモジュールアクセスできない

<?xml version="1.0"?> 
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd"> 
    <acl> 
     <resources> 
      <resource id="Magento_Backend::admin"> 
       <resource id="Spaarg_Tables::tables" title="tables" sortOrder="100"/> 
<!--AddMenuAcl--> 
      </resource> 
     </resources> 
    </acl> 
</config> 

menu.xml

<?xml version="1.0"?> 
<!-- 
/** 
* Copyright © 2015 Spaarg. All rights reserved. 
*/ 
--> 
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd"> 
    <menu> 
     <add id="Spaarg_Tables::spaarg_tablesgrid_index" title="Tables" module="Spaarg_Tables" sortOrder="20" dependsOnModule="Spaarg_Tables" action="tables/tablesgrid/index" resource="Spaarg_Tables::spaarg_tablesgrid_index"/> 
<!--AddMenu--> 
    </menu> 
</config> 
acl.xml

System.Xmlのここ

<?xml version="1.0"?> 
<!-- 
/** 
* Copyright © 2015 Magento. All rights reserved. 
* See COPYING.txt for license details. 
*/ 
--> 
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd"> 
    <system> 
     <section id="payment"> 
      <!-- payment-group --> 
     </section> 
     <section id="carriers" translate="label" type="text" sortOrder="320" showInDefault="1" showInWebsite="1" showInStore="1"> 
      <!-- carrier-group --> 
     </section> 
     <section id="tables" translate="label" type="text" sortOrder="330" showInDefault="1" showInWebsite="1" showInStore="1"> 
      <!-- tables-group --> 
     </section> 
    </system> 
</config> 

は私のコントローラである index.phpの

<?php 
namespace Spaarg\Tables\Controller\Adminhtml\TablesGrid; 

use Magento\Backend\App\Action; 
use Magento\Backend\App\Action\Context; 
use Magento\Framework\View\Result\PageFactory; 


class Index extends Action 
{ 
    /** 
    * @var \Magento\Framework\View\Result\PageFactory 
    */ 
    protected $resultPageFactory; 

    /** 
    * @var \Magento\Backend\Model\View\Result\Page 
    */ 
    protected $resultPage; 

    /** 
    * @param Context $context 
    * @param PageFactory $resultPageFactory 
    */ 
    public function __construct(
     Context $context, 
     PageFactory $resultPageFactory 
    ) 
    { 
     parent::__construct($context); 
     $this->resultPageFactory = $resultPageFactory; 
    } 

    public function execute() 
    { 

     $this->resultPage = $this->resultPageFactory->create(); 
     $this->resultPage->setActiveMenu('Spaarg_TablesGrid::tables'); 
     $this->resultPage ->getConfig()->getTitle()->set((__('TablesGrid'))); 
     return $this->resultPage; 
    } 

    protected function _isAllowed() 
    { 
     return $this->_authorization->isAllowed('Spaarg_TablesGrid::tables'); 
    } 

} 

それは私は、Magentoのに新しいです 、私のモジュールのためのユーザの役割でチェック示しています、誰かがこれを処理する方法を提案できるなら、それは素晴らしいことでしょう。

+0

@ManthanDaveあなたの迅速な対応に感謝します。はい、管理者ユーザーです。 – Anand

+0

いいえ、何も必要ありません。そのユーザー、カタログ、カスタムモジュールでアクセスするモジュールが2つだけ必要です。それ以外はクリアなマゼンタキャッシュがあり、再インデックスも実行されますが、今は運がありません。 – Anand

+0

はい、あなたが言ったことを正確に行いました。リソースアクセスとして「すべて」を選択するとモジュールが表示されますが、チェックボックスで「カスタム」選択を使用すると機能しません。 – Anand

答えて

1
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd"> 
    <acl> 
     <resources> 
      <resource id="Magento_Backend::admin"> 
       <resource id="Magento_Backend::stores"> 
        <resource id="Magento_Backend::stores_settings"> 
         <resource id="Magento_Config::config">        
          <resource id="Spaarg_Tables::tables" title="tables" sortOrder="100"/> 
         </resource> 
        </resource> 
       </resource> 
      </resource> 
     </resources> 
    </acl> 
</config> 
+0

あなたはmagento関連の質問をhttp://magento.stackexchange.com/ –

+0

の中に投稿する必要があります – Anand

関連する問題