Permalink
Browse files

MDL-7250 update to previous change to do in SQL as suggested

  • Loading branch information...
1 parent 4c7701a commit d0f6aa914ad683047a138b33b23f4a63e379a056 sam_marshall committed Oct 27, 2006
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/accesslib.php
View
@@ -128,10 +128,9 @@ function load_defaultuser_role() {
}
if ($capabilities = get_records_select('role_capabilities',
- "roleid = $CFG->defaultuserroleid AND contextid = $sitecontext->id")) {
+ "roleid = $CFG->defaultuserroleid AND contextid = $sitecontext->id AND capability <> 0")) {
foreach ($capabilities as $capability) {
- if (!isset($USER->capabilities[$sitecontext->id][$capability->capability])
- && $capability->permission != 0) { // Don't overwrite if it's already set, nor store 'inherit'
+ if (!isset($USER->capabilities[$sitecontext->id][$capability->capability])) { // Don't overwrite
$USER->capabilities[$sitecontext->id][$capability->capability] = $capability->permission;
}
}

0 comments on commit d0f6aa9

Please sign in to comment.