Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
There might have been some sort of reason that we didn't do this, but if so, I can't remember what it is. But it's confusing that when you look at user 1's roles, 'administrator' is not in the list.
Comment | File | Size | Author |
---|---|---|---|
#8 | assign_administrative_role_uid_1.patch | 738 bytes | dmitrig01 |
#5 | assign_administrative_role_uid_1.patch | 773 bytes | dmitrig01 |
#3 | assign_administrative_role_uid_1.patch | 756 bytes | dmitrig01 |
Comments
Comment #1
David_Rothstein CreditAttribution: David_Rothstein commentedPseudo-duplicate of #572240: Explain in the user interface that user/1 and the "administrator" role are not the same thing (although not quite).
You're welcome to join me in making that argument over there - a few months ago I was not successful in convincing anyone :)
Comment #2
rfayI think we should get this done.
Comment #3
dmitrig01 CreditAttribution: dmitrig01 commentedI couldn't find any APIs. Don't know if this is the right approach (see #572240: Explain in the user interface that user/1 and the "administrator" role are not the same thing - quite interesting issue actually)
Comment #4
dmitrig01 CreditAttribution: dmitrig01 commentedComment #5
dmitrig01 CreditAttribution: dmitrig01 commenteda working patch would be nice.
Comment #6
David_Rothstein CreditAttribution: David_Rothstein commentedLooks good! Although should probably use the compact form of the DB query (just
fields
as an associative array, novalues
). In the earlier patch at the other issue there was an additional bugfix needed to prevent the installer from clobbering any roles assigned to user 1, but I believe I got that committed elsewhere more recently.... in any case, this seems to work as is.The pros and cons of this patch are discussed in some detail at #572240: Explain in the user interface that user/1 and the "administrator" role are not the same thing. I still think the pros win :)
Comment #7
winston CreditAttribution: winston commentedI won't do it, but I think this should be marked as a duplicate of #572240 as that is where most of the discussion of the issues is.
I personally think it is a problem for user/1 to be assigned to the administrator role as it implies that you can control the permissions of user/1 when you really can't. More discussion on option in #572240.
Comment #8
dmitrig01 CreditAttribution: dmitrig01 commentedWould something like this work? (untested)
Comment #9
David_Rothstein CreditAttribution: David_Rothstein commentedYup, that looks good (and I tested that it works).
Codewise, at least, this is RTBC - I guess otherwise there is not quite agreement yet. Part of the idea of #572240: Explain in the user interface that user/1 and the "administrator" role are not the same thing was that this would be accompanied by some user-1-only help text on the permissions page that would alleviate confusion (confusion which exists with or without this patch, in my opinion, though), so maybe it should be a duplicate after all.
Comment #10
Dries CreditAttribution: Dries commentedI'm also surprised we don't have an API function for this. I spent 10 minutes looking and couldn't find anything. Seems like a good todo for Drupal 8. Given that, I'm going to mark this as RTBC.
Comment #11
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #12
dmitrig01 CreditAttribution: dmitrig01 commented#800378: Add a function to assign users to roles
Comment #13
winston CreditAttribution: winston commentedSo would I now file a bug report that modifying the permissions for the administrator role has no affect on whatever I called user/1?
Frankly if I don't someone else I'm sure will (probably after D7 is released).
I'm very disappointed that this was committed without even a tip of the hat to the issues discussed in #572240: Explain in the user interface that user/1 and the "administrator" role are not the same thing.