82701e2443
This is part 1 that does the back-end: 1. New table role_allow_switch. 2. Upgrade that copies all the allows from role_allow_assign, and then drops the old CFG->allowuserswitchrolestheycantassign. 3. Old function get_assignable_roles_for_switchrole renamed to get_switchable_roles and changed to use the new table. Fixes MDL-18604 in HEAD. 4. Switch callers to use the new function name. 5. Unit tests for this new function. 6. To make those unit tests work, new switch_global_user_id and revert_global_user_id methods in UnitTestCaseUsingDatabase for toggling $USER->id. I still need to do the editing interface under Administration ► Users ► Permissions ► Define roles. That will be done as a second commit.