How to Implement ACL in Magento 2 Extensions

How to Implement ACL in Magento 2 Extensions

Magento is by far the most robust and feature rich platform in the Ecommerce world. After the recent release of Magento version 2, developers are in a race to upgrade the extension in this latest version. At this stage, you really need to implement ACL into the extension to grant limited access for the view and use of functionalities, features. This role can be used the most when you setup a demo store for the extension. Without creating user roles, the demo store will show up whole admin panel with all the tabs those are unnecessary for the particular view and use of the extension. This arises the need of implementing ACL for your extension.

This step to step guide will walk you through implementing ACL and adding new user roles in your Magento extension and allowing them the necessary access to features and functionality.

First of all,

  1. Create file acl.xml in app/code/[companyname]/[extension_name]/etc/acl.xml and add below code:
    
    
      
        
          
            
              
                
                  	
                
              
            
          
        
      
    
    
  2. Please take resource id from the system.xml of the extension you have developed.
    App/code/[companyname]/[extension_name]/etc/adminhtml/system.xml

Feel free to post the comments if you have any suggestion or problem with it.

Previous Article

How to Redirect Category with Single Product to Product Page in Magento 2

Next Article

How to Set Up Cron Jobs in Magento 2

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Get Connect With Us

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨