Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
  • #3420

    As the super admin, if I go to Network->Sites, edit a site and go to users, it doesn’t let me change the Role of a user. I can if I go to that site and change it there.

    I get the message: Sorry, you are not allowed to give users that role.


    Just been trying to solve it.

    So under a clean installation of WordPress and URE Pro, I can’t change a user’s role from Sites section, but I can go into the subsites admin and under users, I can change it there.

    Why is it that a Super Admin can’t change the user role from the Sites section?


    My test showed that WordPress includes to the roles drop-down list here all roles from all subsites. I just added new role “Main site only” at the main site. Then went to ‘edit’ page of site selected via the “Network admin -> Sites”, and saw that role in drop-down list for subsite. It’s not correct, this is a WordPress bug possibly.
    If you try to assign to a user a role from site 1 which does not exist at site B, then you will receive such error message: “Sorry, you are not allowed to give users that role.”. You can not assign to a user not existing (at this subsite) role.


    Additional test showed that roles drop-down list opened for any subsite under “Network Admin -> Sites” shows a list of roles from the main site, not all roles from all subsites as I wrote above.
    WordPress core does not takes into account here that roles list can be different between subsites. So if roles are not synchronized between subsites you can get such error message.

    You have to remember that wordpress stores roles for subsites separately for every subsite.

    I will look if it’s possible to fix this issue via a suitable hook.


    I don’t know if you understood.

    I am not trying to add a role that isn’t on the subsite already. In fact, I am only trying to change to a default WordPress role.

    So as a Super Admin I go into Network Admin, Sites and edit a subsite, go to users and try to change a user from Author to Editor then I get the error.

    If I go into that subsites admin page, then users and change it there it works.


    I can not repeat this for any role from the list of built-in WordPress roles. I got such error message just for the situation I described above. When I select any role which exists for subsite then user’s role is changed as expected.

    Deactivate URE and test. Will you get the same result? If YES, you will get the same error message, then some other plugin or theme can take effect.


    Just tried on a test setup, turned off URE and still doing it.


    Is any other plugin active?
    Try do deactivate all plugins. If issue will not be repeated, activate theme back one by one to isolate a conflicting code.


    All plugins disabled.

    Still doing it.


    This is a video how it works at my test setup with all plugins deactivated.

    It’s definitely not related to URE. I can just suppose that something is wrong with your installation.

    You can send to suport [at-sign] a download link to your test installation database backup. I will try to repeat this issue at my local test environment, where I can debug it (if it will be repeated) to isolate a reason. Send me your test wp-config.php also.


    Scrap all that. The reason why I was getting confused over which was which was because of the way I was doing it.

    If I change the role via the drop down at the top of the list. It works. If I change it using the drop list at the bottom, that’s when I get the error.

    So next question, is this a URE bug or a WordPress bug?


    Yes, it’s definitely a WordPress bug. Look at wp-admin/network/site-users.php, from line #141:

    if ( empty( $editable_roles[ $_REQUEST['new_role'] ] ) ) {
    				wp_die( __( 'Sorry, you are not allowed to give users that role.' ) );

    But when you click ‘Change’ button from the bottom ‘new_role’ is empty, new role value is sent with ‘new_role2’ parameter. But ‘new_role2’ is never checked.

    P.S. I will remove your posts with roles data as unrelated to the subject – data before and after are identical.


    Ok, thanks for the help in working this out.

    Now is this a reported bug, and if not how do I report bugs? Never found one before to report.


    I never reported WordPress bugs yet. Look at this guide.
    I did not find any bug which mention ‘new_role2’.
    There will be no problem if you will not find if this bug is reported or not, I think. Moderator will do it, finally.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.