Wrong role gets admin access
| Project: | Admin Role |
| Version: | 5.x-1.5 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
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
subscribing
#2
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
Strange.. you are absolutely right! What a stupid bug. I will fix this ASAP.
#4
Okay, I think this fixes it. Please patch and confirm ASAP so I can commit the code to CVS.
#5
I applied the patch and tested it, and it now works correctly.
Thanks!
#6
Committed in DRUPAL-5
#7
#8
Automatically closed -- issue fixed for two weeks with no activity.