2

I have CiviCRM installed on WordPress.

I have duplicated the wordpress Subscriber role (using Members plugin), and then I go to Administer > User and Permissions > Permissions (Access Control) > Wordpress Access Control and I assign ALL permissions to this new role.

I then assign this role to a user, and login with the user.

If I have the WooCommerce plugin activated, the user can not access the CiviCRM menus at https://mysite.com/wp-admin/admin.php?page=CiviCRM ... it gets redirected to the WooCommerce my-account page.

As soon as I disable the WooCommerce plugin, the user now has full access to the CiviCRM menus.

Any thoughts or ideas on how to get around this situation?

Thanks

1 Answer 1

1

We found this to be problematic as well.

You can restore the default Woo admin bar and admin access with code:

add_filter('woocommerce_disable_admin_bar', 'cv_wc_disable_admin_bar', 10, 1);

function cv_wc_disable_admin_bar($prevent_admin_access) {

    return false;
}

add_filter('woocommerce_prevent_admin_access', 'cv_wc_prevent_admin_access', 10, 1);

function cv_wc_prevent_admin_access($prevent_admin_access) {

    return false;
}
2
  • @kevin_cristiano Excellent! The woocommerce_prevent_admin_access solved the issue!!! However, I do not see what the woocommerce_disable_admin_bar filter does though.
    – jsherk
    May 4 at 21:42
  • Woo can also hide the admin bar for non administrators, or at least it did at one time :) things change and that may not be an issue any longer May 4 at 22:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.