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

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

2 days ago

How Upcoming Cookie Changes Will Affect Your E-commerce Website?

The e-commerce world is constantly in flux. New tech and strategies emerge daily to help…

2 days ago

Magento 2: How to Add Header and Footer in Checkout

Hello Magento Friends, In today’s blog, we will discuss adding a header and footer to…

2 days ago

Understanding Flexbox Layout in React Native

Hello React Native Friends, Building a visually appealing and responsive mobile app is crucial in…

4 days ago

HYVÄ Themes Releases: 1.3.6 & 1.3.7 – What’s New

We're thrilled to announce the release of Hyvä Themes 1.3.6 and 1.3.7! These latest updates…

5 days ago

How Modern E-Commerce Platforms Leverage Docker & Kubernetes for Scalability

Your e-commerce platform is surging - orders are rolling in, traffic spikes are becoming the…

6 days ago