Change WordPress user roles and capabilities › Forums › Bug Reports › Super Admin Issues
- This topic has 13 replies, 2 voices, and was last updated 7 years, 8 months ago by Vladimir.
-
AuthorPosts
-
11/03/2017 at 07:15 #3420farmzone.netParticipant
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.
11/03/2017 at 07:46 #3421farmzone.netParticipantJust 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?
12/03/2017 at 01:29 #3425VladimirKeymasterMy 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.12/03/2017 at 01:33 #3426VladimirKeymasterAdditional 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.
12/03/2017 at 01:51 #3427farmzone.netParticipantI 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.
12/03/2017 at 01:57 #3428VladimirKeymasterI 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.
12/03/2017 at 02:26 #3429farmzone.netParticipantJust tried on a test setup, turned off URE and still doing it.
12/03/2017 at 02:44 #3430VladimirKeymasterIs 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.12/03/2017 at 03:09 #3431farmzone.netParticipantAll plugins disabled.
Still doing it.
12/03/2017 at 03:32 #3432VladimirKeymasterThis 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] role-editor.com 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.
12/03/2017 at 04:56 #3435farmzone.netParticipantScrap 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?
12/03/2017 at 05:22 #3436VladimirKeymasterYes, 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.
12/03/2017 at 05:26 #3439farmzone.netParticipantOk, 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.
12/03/2017 at 05:34 #3440VladimirKeymasterI 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. -
AuthorPosts
- You must be logged in to reply to this topic.