• Resolved renan99

    (@renan99)


    Is there any way to allow or block certain users to access this plugin?
    I use User role Editor to limit the areas my employees can access, is there anything like that in this plugin?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tychesoftwares

    (@tychesoftwares)

    Hi @renan99,

    By default only users with ‘Manage WooCommerce’ permission should be able to see the plugin admin dashboard.

    You can use the below code to block user or access the plugin page:

    // Disable Plugins to specific user
    add_action('admin_init', 'desactivate_plugin_role');
    function desactivate_plugin_role()
    {
    global $current_user;
    if (in_array('subscriber', $current_user->roles)) {
    deactivate_plugins( '/woocommerce-abandoned-cart/woocommerce-ac.php' );
    } else {
    activate_plugins( '/woocommerce-abandoned-cart/woocommerce-ac.php' );
    }
    }

    Do let me know if you have any further concerns.

    Thread Starter renan99

    (@renan99)

    Thank you for the reply, I tried the ‘manage_woocommerce’ permission but the Abandoned Cart Lite for WooCommerce doesn’t show up in the menu…

    Im not really good with php, so I prefer to go the other route first..

    Just to confirm, this code I would put in the functions.php right?

    Plugin Author tychesoftwares

    (@tychesoftwares)

    Hi @renan99,

    You can share the code with us you tried using ‘manage_woocommerce’ so that we can help you.

    And yes, the code we shared with you can be added in the functions.php file of the child theme of your site and you can make the necessary changes as per your requirement in regards to user role permission.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘permission roles’ is closed to new replies.