Menu Close
    Hire us Request quote Reading list Switch to dark mode

    Hide Mass Actions Based On Some Conditions in Magento 2

    In this blog, I’ll explain how to hide mass actions based on some conditions like for some admin roles or users. Here we will see how can we remove the whole mass actions or remove only some of the mass actions.

    First you need to provide your own class to be used for the mass action, for this in the ui component xml file add class attribute in the massaction tag as shown below,

    Now let’s first see how to remove the whole mass action container,

    Here the {{CONDITION}} represents the condition you want to use for removing the actions, it can be something like check of admin users or admin user role or even check of ACL authorisation.

    Now let’s see how can we remove only few of the actions,

    Here we have removed the ‘delete’ action from the mass-action.

    Thanks for reading this blog. Feel free to comment if you face any issue.
    Happy Coding 👨‍💻

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again
    Close