user role drop down inaccurate on ms-sites.php
|Reported by:||hughestm@…||Owned by:|
|Component:||Role/Capability||Keywords:||roles, capabilities, network|
If a user has been assigned a role and an individual capability, the user list doesn't show the correct role for the user.
This is the scenario to replicate this issue. User is currently given one role (ie. editor). Then some plug-in adds an individual capability (db has role and cap serialized - order is important). You then go and change the role(ie. publisher) of that user using ms-sites.php (db has cap then role serialized). When you return to ms-sites.php (not immediate page load, but refresh, or new page load), the drop down menu for the user in question will show Administrator. It appears, that ms-sites is pulling the first item from the serialized list, and since it isn't a role, it doesn't know how to populate the drop down.
This is a particular issue, if you go to the page to change any information not related to user permissions. Anyone whose accounts had the extra cap would suddenly become Administrators.
There may be other scenarios where this same things happens, but as best I can tell this is the particular scenario that is causing me problems.
Also, I do realize that there is a potential for user->role->cap overhaul in a future release, but since it doesn't seem to be part of the 3.1 milestone, I thought this should be fixed.
As another note, the users.php page seems to handle this scenario a bit better. The solution might be over there.