]> git.mjollnir.org Git - moodle.git/commit
role assign: MDL-8312 Restrict which roles can be assigned at which contextlevels.
authortjhunt <tjhunt>
Thu, 6 Nov 2008 07:34:01 +0000 (07:34 +0000)
committertjhunt <tjhunt>
Thu, 6 Nov 2008 07:34:01 +0000 (07:34 +0000)
commit01a80f51e542c4472c9f7808675412fa200ca652
tree167b5252edbf1df94070bc2ccc511de3f6e23630
parent37323148d933c89a125f661a00fcc3f27b9cc6d5
role assign: MDL-8312 Restrict which roles can be assigned at which contextlevels.

* New table role_context_levels
* Populate table with defaults on install
* Populate table on upgrade with the same defaults, plus any additional ones needed to ensure all the role assignments already in the database are allowed.
* Change get_assignable_roles to respect these settings.
* UI for these settings on the add/edit role form.
* Save these settings when a role definition is saved.
* If in a context, there are no roles you can assign, display a polite message.
* Back up these settings.
* Restore these settings. When resotring a <=1.9.x backup file, any newly imported roles are set to be assignable at all contextlevels.

Restore not tested because it is broken in HEAD.
12 files changed:
admin/roles/assign.php
admin/roles/manage.html
admin/roles/manage.php
admin/roles/override.php
admin/roles/tabs.php
backup/backuplib.php
backup/restorelib.php
lang/en_utf8/role.php
lib/accesslib.php
lib/db/install.xml
lib/db/upgrade.php
version.php