]> git.mjollnir.org Git - moodle.git/commit
switch roles: MDL-18132 separate database table role_allow_switch instead of re-using...
authortjhunt <tjhunt>
Mon, 23 Mar 2009 08:15:21 +0000 (08:15 +0000)
committertjhunt <tjhunt>
Mon, 23 Mar 2009 08:15:21 +0000 (08:15 +0000)
commit82701e2443d67464314b3ea234be4fad7c6bb6c6
tree87c7bd2ce7c08e42492f90bb2c85390628a29614
parente437618bdd5770395b02a304a5ab4c84ebd3828d
switch roles: MDL-18132 separate database table role_allow_switch instead of re-using role_allow_assign.

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.
course/view.php
lib/accesslib.php
lib/db/install.xml
lib/db/upgrade.php
lib/simpletest/testaccesslib.php
lib/simpletestlib.php
lib/weblib.php
version.php