User Capabilities & Admin Bar Visibility

I'm trying to lower the capabilities for my clients. I don't want them to have full admin rights because I don't need them to access or edit/install any plugins. I will be handling that for them... However, if I downgrade them to an Editor or Author, then they don't have the ability to see the admin bar. I don't mind downgrading them because I can just edit their capabilities in order to give them more capabilities, but the problem is that the admin bar is completely blank. They can't even log out.

So my goal is to either... limit their capabilities as an admin or simply make the admin bar display to lower roles such as Editors and Authors, so they can see "My Site", Support, "Network Logo favicon" and edit their own profile.

I've attached a screenshot of what they see as an author.... and the problem with not being able to view the site or log out.

  • Rupok

    Hi Jerone, how are you doing today?

    Well, I think this is not normal. Let me explain. If your Authors were not supposed to see the Admin Bar, then there would not be any blank empty bar at the top. For example, when you go to "Edit My Profile" option from the admin bar, and un-check "Show Toolbar when viewing site" this option, do you see any empty black bar in the front-end? You don't. Because when it's natively removed, it should be gone properly.

    Here, an empty black bar is showing which is weird. Many reasons can be behind this. One possible reason is plugin conflict. Can you please do a plugin conflict test just to make sure no other plugin is causing this? To know more about plugin conflict test, you can check this guide: http://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    Now, regarding your query of limiting capability as admin, you can create a completely new user role with This Plugin. This plugin has 300,000+ active installs. So I think it's a good one. With this plugin, you can create a new role and assign custom capabilities as you want to that role.

    If you want to hide any specific admin menu for that user role, then you can use this plugin: https://wordpress.org/plugins/admin-menu-editor/ . I also has 200,000+ active installs.

    I hope these will serve your purpose. Please let us know if you have any confusion or if you are stuck at any point. We will be glad to help.

    Have a nice day. Cheers!
    Rupok

  • Jerone

    Wow...I was thinking the same thing... I could have sworn I saw it and I'm like... OK where is it? lol

    Anyway, it looks like I found the culprit by doing what you suggested and seeing if it was a plugin. Looks like I may have found a bug in the Membership 2 plugin. As soon as I deactivated that plugin , the admin bar came right back when I was logged in as an Author... and as soon as I activated it, the admin bar disappeared again. So either I found a bug or I have a setting that's not correct. I thought it would be as simple as disabling the option where it says "Hide admin bar from non administrators" within the Membership 2 settings, but that did not make the admin bar come back. Only deactivating the plugin does...

    Are there any other settings within the Membership 2 plugin that could cause this?

    Also, to ensure it wasn't any other plugin, I deactivated all the plugins and reactivated them one by one and Membership 2 was the only plugin that made the admin bar disappear.

    As for limiting the admin capabilities for my clients, I will look into the plugin you suggested now and report back.

    Is there any other setting that would hide the admin bar from non-administrators? If not, then I think this needs to go to the developers.

  • Nithin

    Hi Jerone,

    Hope you are doing good today. :slight_smile:

    Are there any other settings within the Membership 2 plugin that could cause this?

    There isn't any other than the option, other than Hide admin toolbar under Membership 2 > Settings > General. I wasn't able to replicate this issue, as disabling the Hide admin toolbar option changed the admin bar from black to normal.

    If its okay for you then please grant support staff access so I can take a closer look. You can grant access from WPMU DEV > Support > Support Access > Grant Access, or check this manual: http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Please let us know once you enable access, so that we could give a closer look. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

  • Nithin

    Hi Jerone,

    Hope you are doing good today. :slight_smile:

    I checked your website, and create a new user wpmutest through your admin, and tried checking with various roles, but the admin bar seems to look fine, I wasn't able to notice the black admin bar. Only when I enabled the Hide admin toolbar option, the admin bar became black again. I tried with various roles, but the result still remains the same.

    Please advise what I'm missing, so that we could give a closer look. Have a nice weekend. :slight_smile:

    Kind Regards,
    Nithin

  • Jerone

    Alright, well based on what you said, I was able to find that this issue was isolated to one website within my network. Oddly enough, I logged in as an admin on that site and saw that the Membership 2 plugin existed, but it wasn't set up. I actually didn't want it to be set up, because I don't really need my client sites to have membership functionality at the moment. Is there a way for me to change that because for this particular site, it's not neccesary. I only wanted my main site to have a membership and that was going to be for my clients to be members of my site. Anyway, when I temporarily set it up on my client site, I went in and disabled the setting that said "hide admin bar from non-administrators" and the bar showed up. Then I deleted the membership to see what would happen and it's still there, but it still redirects the user to the account page where they get to check their account. I really don't need this to happen. At the end of the day, all I want them to do is be able to see their admin bar, so they can contact me for support, visit their site, and logout. Any suggestions lol... I still don't know if this works without the membership 2 plugin... but again I remember disabling that plugin and the admin bar showed up fine.... but it seems to only be affecting this site.

  • Nithin

    Hi Jerone,

    Hope you are doing good today. :slight_smile:

    Oddly enough, I logged in as an admin on that site and saw that the Membership 2 plugin existed, but it wasn't set up. I actually didn't want it to be set up, because I don't really need my client sites to have membership functionality at the moment.

    I checked your website, netprofxxxxxxx.com, so it seems like you have enabled Membership 2 Pro plugin network wide? If you are looking to work the plugin only on mainsite, you'll only have to activate the plugin in your main site, network enable is not required. But if you are looking for a network wide membership, please make sure to enable network-wide protection mode, by adding the following lines in wp-config.php file:
    define( "MS_PROTECT_NETWORK", true );

    Anyway, when I temporarily set it up on my client site, I went in and disabled the setting that said "hide admin bar from non-administrators" and the bar showed up. Then I deleted the membership to see what would happen and it's still there, but it still redirects the user to the account page where they get to check their account. I really don't need this to happen.

    I'm not sure whether I get you here, have you network enabled the plugin, and configured it per site? Since you have configured the plugin for your subsite, even if you delete the membership plan, the Hide admin toolbar option settings will still apply to these users, you'll have to enable/disable these settings, instead of deactivating the plugin.

    If you meant that the Hide admin toolbar setting doesn't work, please do point out the subsite ,so that we could give a closer look.

    But if the network enabled plugin is configured per subsite, even if you remove all the membership pages created during configuration, and even the membership plans, the registered user will still be marked as a visitor in the membership plugin, hence the Hide admin toolbar setting will still apply to these users, easiest would be delete the user, under Users > All Users, and add them directly through your admin.

    Which particular subsite are you having this issue? If you still have issues, could you please point that out, so that we could give a closer look, and check.

    Kind Regards,
    Nithin

  • Jerone

    I went in and changed the Membership 2 plugin to not be network enabled and everything looks good. I only have it enabled on my main site. Users are no longer being redirected to their account page upon login. They are going straight to the dashboard, which is exactly what I need them to do... and they are able to log out. Thank you so much for all your help and I'll be sure to add that line you suggested for protection, should I decide to network enable the Membership 2 plugin.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.