Categories: How ToMagento 2

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.

Click to rate this post!
[Total: 4 Average: 3]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate ?️ Certified Magento Developer?‍?. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.?

Recent Posts

How to Add Tooltip in Checkout Shipping Field in Magento 2?

Hello Magento Friends, In today’s blog, I will explain How to Add Tooltip in Checkout…

2 days ago

How to Integrate and Use MongoDB with Laravel?

MongoDB is a popular NoSQL database that offers flexibility and scalability when handling modern web…

3 days ago

NodeJS | Callback Function

In NodeJS, callbacks empower developers to execute asynchronous operations like reading files, handling requests, and…

4 days ago

How to Show SKU in Order Summary in Magento 2?

Hello Magento Friends, In today’s blog, we will learn How to Show SKU in Order…

6 days ago

Best Colors to Use for CTA Buttons

The "Buy Now" and "Add to Cart" buttons serve as the primary call-to-action (CTA) elements…

1 week ago

Magento 2: How to Save Custom Field Value to quote_address for Multi-Shipping Orders

Hello Magento Friends, In Magento 2, the checkout process allows customers to choose multiple shipping…

1 week ago