When a user that has administration privileges edits another user account, the 'You do not have permission to unblock .' always pops up.
I traced it to how it is passing the permission to the user_access() function. The $account that gets passed in has a roles array, but it looks like this:
array (
8 => '8',
10 => '10',
12 => '12');
Where the code is expecting the $account->roles array to look like this:
array (
8 => 'editor',
10 => 'teacher',
12 => 'staff );
As a result, when you save the user account, the update is successfully saved, but you see the dsm:
'You do not have permission to unblock .'
Comment | File | Size | Author |
---|---|---|---|
#3 | check_role_name-2106945-1.patch | 732 bytes | rogical |
Comments
Comment #1
rich.yumul CreditAttribution: rich.yumul commentedAttached is my patch that grabs the user roles and fixes the array that is checked.
Comment #3
rogical CreditAttribution: rogical commentedre-rolled the patch.
Comment #4
BWPanda CreditAttribution: BWPanda commentedWorks fine for me.
Comment #6
AdamPS CreditAttribution: AdamPS commentedI intend to fix this as part of #2378869: Meta-issue for Beta 2 release. Please sign up as a follower of that issue and see the patch there that I would like feedback on.
I no longer see this bug. I've not taken the patch from here as I'd changed the logic around anyway to fix other issues. Please confirm my new patch works for you.
Comment #7
AdamPS CreditAttribution: AdamPS commentedFix now available in latest release