2

How to disable certain buttons of the features to specific roles in the admin panel. For eg If the role "tester" is given access to view feature in sales/customize-feature in the admin panel, he should not be able to view "Add New " Button. It's customized feature and not present in ACl list

Tried Magento 2 : How to disable/enable payment method based on customer? but did not work out.

I want to hide "Save And Email to the customer" but I am unable to find it in ACL file. Even I select only "My Quote/Order" with rest checkbox uncheck all features work on the admin panel of the desired role where i have to hide it.

Tried to disable via ACL but it did not work out

 <?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="Magento_Sales::sales">

                <resource id="TREO_MyQuote::quoteTop" sortOrder="150" title="My Quote/Order">
                        <resource id="TREO_MyQuote::quote" sortOrder="90" title="My Quote/Order">
                            <resource id="TREO_MyQuote::quotecto" sortOrder="90" title="CTO"/>
                            <resource id="TREO_MyQuote::approve_action" sortOrder="90" title="My Quote/Order Approve"/>
                            <resource id="TREO_MyQuote::send_email_to_customer" sortOrder="90" title="Order Send email to customer"/>
                        </resource>
                    </resource>
                </resource>

            </resource>
        </resources>
    </acl>
</config>
  • Disabling the button would be a lot of work but you should be able to disable the action it performs, which would show an error if someone tried. I haven't done this but maybe it helps to think of it this way – jamil Mar 22 at 20:27
  • 1
    Thx , i found 2 solution 1> To check in ACL and disable the action as mentioned above 2> To call all buttons and create customized button. If similar functionality is already developed then how to check which files it has used as its not done via ACL method – insoftservice Mar 23 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.