Wrong role gets admin access

bdornbush - August 21, 2008 - 01:09
Project:Admin Role
Version:5.x-1.5
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

I just installed adminrole.
I enabled the module.
I went to admin/user/adminrole and selected one role, in my case, "content editor."
I checked admin/user/access and it was as expected. But I realized that this gave too much access control to that role, so I decided to use a different role.
I went to admin/user/adminrole and selected another role, in this case, "test." This role was the last role in the dropdown list.
I checked admin/user/access and found that the role next to this role in the dropdown list (in my case "Permanent Judicial Commission") now had all access privileges. The original role selected, "content editor," still had all access rights, which I can understand.
I went to admin/user/adminrole and selected the original role, "Content editor." I then removed all unwanted access rights for "Permanent Judicial Commission."
I selected "test" again, and again "Permanent Judicial Commission" got all access rights.
I reset the adminrole to "content editor" and removed all "Permanent Judicial Commission" access rights.
I selected "Permanent Judicial Commission" and the role before this role in the dropdown list, "Pastors," got all access rights.

I don't know why it worked the first time, and will work repeatedly for one role, but repeatedly selects the role before the one I select lower in the dropdown list. But needless to say, this is not good.

BTW, I have a large number of roles on this system, about 19. I don't know if this is relevant to this problem.
I also note that "content editor" is the first role in the dropdown list after "anonymous user" and "authenticated user."

#1

arhak - August 21, 2008 - 01:36

subscribing

#2

JacobSingh - August 22, 2008 - 05:31

Huh...

That's a little odd. If you can paste the contents of your role table, it might help me identify if there is a bug there.

Can you run this:

mysqldump -uUSER -pPASS my_db_name roles > /tmp/adminrolebug.sql

and then attach that here, or send to me on my email via the contact form.

#3

JacobSingh - August 22, 2008 - 05:40

Strange.. you are absolutely right! What a stupid bug. I will fix this ASAP.

#4

JacobSingh - August 22, 2008 - 05:47
Priority:normal» critical

Okay, I think this fixes it. Please patch and confirm ASAP so I can commit the code to CVS.

AttachmentSize
ksort_bug.patch 1.75 KB

#5

bdornbush - August 22, 2008 - 23:36

I applied the patch and tested it, and it now works correctly.

Thanks!

#6

JacobSingh - August 27, 2008 - 07:13
Status:active» patch (to be ported)

Committed in DRUPAL-5

#7

JacobSingh - August 27, 2008 - 07:18
Status:patch (to be ported)» fixed

#8

Anonymous (not verified) - September 11, 2008 - 05:32
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.