Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit d0f6aa914ad683047a138b33b23f4a63e379a056 1 parent 4c7701a
sam_marshall authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/accesslib.php
View
5 lib/accesslib.php
@@ -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;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.