Change WordPress user roles and capabilities › Forums › Restrict or Permit access inside WordPress – how to › Create new Role – no dashboard access
- This topic has 7 replies, 2 voices, and was last updated 7 years, 10 months ago by
Vladimir.
-
AuthorPosts
-
31/12/2017 at 22:19 #4526
cgharing
SpectatorSorry 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.How can I fix
Thanks
Chris31/12/2017 at 23:52 #4527cgharing
SpectatorOk, fixed problem needed to add “view_admin_dashboard” to New roles.
Thanks
Chris01/01/2018 at 03:44 #4528Vladimir
KeymasterHi Chris,
Thanks for letting me know that you resolved a problem.
02/01/2018 at 00:35 #4529cgharing
SpectatorHello Vladimir, love the plugin.
I don’t know how to fix thisthis 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.what did i do wrong.
Thanks
Chris02/01/2018 at 03:55 #4530Vladimir
KeymasterHi Chris!
It could be related to some other plugin.
One possible source of a problem is WooCommerse: https://role-editor.com/woocommerce-admin-bar-access/
Try to deactivate WooCommerce temporally and re-test.02/01/2018 at 19:38 #4532cgharing
SpectatorHello Vladimir
Yes, you are correct, I added the rights to Create,edit and publish posts. the user now has access to the tool bar when browsing sight.
Thank You for resolving issue.
Chris
02/01/2018 at 22:06 #4533cgharing
SpectatorHello Vladimir
quick update, made solution that is pretty clean and easy to do, and you can grant tool bar access to any roll you make.
I made a capability and called it ‘see admin toolbar’
then added it to the 2 files you pointed out in your link.
works great, I can make new role now and give it see admin toolbar right and you get toolbar on front page regardless of edit posts.
Very exciting
Thanks03/01/2018 at 03:13 #4535Vladimir
KeymasterHi Chris,
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; } -
AuthorPosts
- You must be logged in to reply to this topic.