cancel
Showing results for 
Search instead for 
Did you mean: 

ACL Resources for customer attribute

ACL Resources for customer attribute

Hi,


I want to create an ACL Resource for custom customer attribute. I didn't found anything relevant with this.. 
Please help me with this. 
Thank you in Advance Smiley Happy

Karuna Khatri


 

2 REPLIES 2

Re: ACL Resources for customer attribute

Hello,
If you want to create the custom module ACL: Create file in your module at : app/code/Vendor/Module/etc/acl.xml

<?xml version="1.0"?>
<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="Vendor_Module::save" title="Module" sortOrder="10" >
                <resource id="Vendor_Module::module" title="Module" sortOrder="0" />
            </resource>
        </resource>
    </resources>
</acl>
</config>

Note: Please make sure to add comman resource id in your admin Controller:

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

This will create a New Permissions in admin=> System =>Roles/Permission section.
For more information refer this link https://www.generacodice.com/en/articolo/3266830/how-to-create-acl-for-customer-user-in-magento-2
Happy coding Smiley Happy

Re: ACL Resources for customer attribute

Hello @karuna_khatri,

 

please visit Magento Devdocs, you will find the solution over there.

 

Thanks & Regards