Permalink
Browse files

MDL-15690, MDL-16518 backup - include roles with overrides (not only …

…with assignments). Credit goes to Clinton Graham.
  • Loading branch information...
1 parent 6f80633 commit 56eece4e5425f6457d3dd03f4b2b16d39966ef74 stronk7 committed May 7, 2009
Showing with 7 additions and 2 deletions.
  1. +7 −2 backup/backuplib.php
View
@@ -2843,9 +2843,14 @@ function backup_fetch_roles($preferences) {
}
}
- // foreach context, call get_roles_on_exact_context insert into array
+ // foreach context, call get_roles_on_exact_context + get_roles_with_override_on_context() and insert into array
foreach ($contexts as $context) {
- if ($proles = get_roles_on_exact_context($context)) {
+ if ($proles = get_roles_on_exact_context($context)) { // Look for roles assignments
+ foreach ($proles as $prole) {
+ $roles[$prole->id] = $prole;
+ }
+ }
+ if ($proles = get_roles_with_override_on_context($context)) { // Look for roles overrides
foreach ($proles as $prole) {
$roles[$prole->id] = $prole;
}

0 comments on commit 56eece4

Please sign in to comment.