Sorry probably a old question, I have been using pro version for some time but with pre-configured roles and plug in roles added by plugins ( works great).
I decided to add new roles and restrict what they can do.
Problem the new roles can’t access the dashboard.
Hello Vladimir, love the plugin.
I don’t know how to fix this
this problem only happens on the new roles i created. they can login to the back end of site and have tool/admin bar, but when go to site or store the tool/admin bar goes away.
this doesn’t happen with any pre defined roles just the new one I made.
Be aware that editing plugins source files is not a good practice. All changes will be lost after the next plugin update. And you will have to make the same changes again.
The better solution is to edit your child theme functions.php file only:
add_filter('woocommerce_disable_admin_bar', '_wc_disable_admin_bar', 10, 1);
function _wc_disable_admin_bar($prevent_admin_access) {
if (!current_user_can('see_admin_toolbar')) {
return $prevent_admin_access;
}
return false;
}