mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Don't overwrite capabilities when loading default role
This commit is contained in:
parent
8f8ed475f7
commit
ca23ffdb74
@ -121,7 +121,9 @@ function load_defaultuser_role() {
|
||||
if ($capabilities = get_records_select('role_capabilities',
|
||||
"roleid = $CFG->defaultuserroleid AND contextid = $sitecontext->id")) {
|
||||
foreach ($capabilities as $capability) {
|
||||
$USER->capabilities[$sitecontext->id][$capability->capability] = $capability->permission;
|
||||
if (!isset($USER->capabilities[$sitecontext->id][$capability->capability])) { // Don't overwrite
|
||||
$USER->capabilities[$sitecontext->id][$capability->capability] = $capability->permission;
|
||||
}
|
||||
}
|
||||
|
||||
// SPECIAL EXCEPTION: If the default user role is actually a guest role, then
|
||||
|
Loading…
x
Reference in New Issue
Block a user