Site admins have insufficient permissions to access dashboards

Hi,

We discovered a problem today in our site network http//mediajungle.dk, that might have gone un-noticed since we upgraded site core and plugins in January.

The problem: Students / network members can’t access the dashboard in their own newly created sites. Access to older sites is still OK. When trying to access new site’s dasboards, they all get this message:

“You do not have sufficient permissions to access this page.”

Any idea what might cause this? Everything is upgraded to latest versions, and I tried renaming the plugins folder temporarily, but no difference.

Regards

Kristian

  • cpilko
    • Design Lord, Child of Thor

    I had a similar problem around the same time. My issue was something wiped my _USER_ROLES database entries for some, but not all sites. I couldn’t even visit the dashboard of the affected sites as a Network Admin, and couldn’t assign users roles in the sites.

    I spent the better part of a Saturday fixing this. I posted my solution at WP.SE

    http://wordpress.stackexchange.com/questions/82520/troubleshooting-a-you-do-not-have-sufficient-permissions-to-access-this-page-e/82521#82521

  • strobech
    • Design Lord, Child of Thor

    @cpilko: Thanks! Think I need to sit through this with a colleague from our IT department and that can’t happen until Monday, so I will get back on this after the weekend. I wonder if we should try a search through the database for faulty prefixes..

  • strobech
    • Design Lord, Child of Thor

    OK, so now we briefly implemented @cpilko’s method live on our network:

    http://wordpress.stackexchange.com/questions/82520/troubleshooting-a-you-do-not-have-sufficient-permissions-to-access-this-page-e/82521#82521

    This resulted in the following error page output:

    You do not have sufficient permissions to access this page.

    Array

    (

    [Pages No Access] => Array

    (

    [index.php] => 1

    [separator1] => 1

    [edit.php] => 1

    [upload.php] => 1

    [link-manager.php] => 1

    [edit.php?post_type=page] => 1

    [edit-comments.php] => 1

    [separator2] => 1

    [themes.php] => 1

    [plugins.php] => 1

    [profile.php] => 1

    [tools.php] => 1

    [options-general.php] => 1

    [separator-last] => 1

    [psts-checkout] => 1

    )

    [User Info] => WP_User Object

    (

    [data] => stdClass Object

    (

    [ID] => 4

    [user_login] => amal

    [user_pass] => $P$B9JlpFKMZfA3OSKSCVY.knGJAQOwco1

    [user_nicename] => amal

    [user_email] => email@gmail.com

    [user_url] => http://mediajungle.dk/members/amal/

    [user_registered] => 2011-03-04 16:39:57

    [user_activation_key] =>

    [user_status] => 0

    [display_name] => amal

    [spam] => 0

    [deleted] => 0

    )

    [ID] => 4

    [caps] => Array

    (

    [bbp_participant] => 1

    [bbp_keymaster] => 1

    )

    [cap_key] => jng_3123_capabilities

    [roles] => Array

    (

    )

    [allcaps] => Array

    (

    [bbp_participant] => 1

    [bbp_keymaster] => 1

    )

    [filter] =>

    )

    [Roles] => Array

    (

    [administrator] => Administrator

    [editor] => Editor

    [author] => Author

    [contributor] => Contributor

    [subscriber] => Subscriber

    )

    )

    According to @cpilko this means that the failure of admins not being able to access their own dashboards is being generated by the WP Core. Question is how do I proceed from here?

    Regards

  • cpilko
    • Design Lord, Child of Thor

    This was one of the issues I had: Your user has no roles.

    See if you have another user in your database where the roles are intact. Otherwise, you’ll need to copy these roles from another WordPress install or a backup.

  • cpilko
    • Design Lord, Child of Thor

    This is a site-related problem, not a user-related problem, so you’ll be looking in the database for the site. The issue is you have users, but the site doesn’t have and defined roles for the users.

    For the role, you’ll be looking in the ‘wp_[SITE_NO]_options` table for the ‘wp_[SITE_NO]_user_roles’ row.

    The record is quite large, so I’ve put this in a pastebin paste. I know I’ve got some plugins that added custom roles to this.

    http://pastebin.com/V0pYYgkx

  • strobech
    • Design Lord, Child of Thor

    Thanks again @cpilko :slight_smile:

    But I guess I need a lot more specific step by step help, sorry to say.

    Maybe @aristath is still listening in?

    I have +3000 sites in my network, and my biggest worry is that everyone of them needs database fixing ..

    Thanks,

    Kristian

  • strobech
    • Design Lord, Child of Thor

    Thanks Ari, and @cpilko again.

    New developments since I wrote my latests post yesterday: Just a few minutes ago, I discovered that our network is back to normal performance again. But only for newly created sites, where admins again can access their dashboards. The sites that had this problem, all created last week, are still inaccessible. In the process of error hunting I have removed about a dozen non-wpmudev plugins from the network over the past few days, and I suspect one of them were causing the problem. Which one, I don’t know.

    A curious thing: One of the first plugins I removed was BuddyPress. Its not at all widely used among our students and I have been wanting to simplify our installation for a while. This was the opportunity to do so, so I disabled it. But I do suspect BuddyPress has something to do with all this, because of some other bad functionality that hit us last week, and that all stopped as soon as i disabled BuddyPress.

    I guess it would be interesting to get to the bottom of this – and to let plugins in again, one by one, but my users can’t take anymore dsiruption just now, so I wont be doing that for a while.

    Cheers,

    Kristian

  • cpilko
    • Design Lord, Child of Thor

    @strobech:

    I’m not optimistic that removing the offending plugin will fix this. In my case, I removed all plugins and reinstalled WP, and in my case the problem didn’t go away.

    I’ve got some time today. Let me see if I can hack together a script to restore these permissions for the blogs where they are missing.

    Thanks to you both for the rep points BTW.