MDL-10965 courses: capability to browse course list

This commit is contained in:
Marina Glancy
2019-04-10 12:35:28 +02:00
parent e9cbc45484
commit beff3806d6
38 changed files with 543 additions and 259 deletions
+2 -5
View File
@@ -4626,11 +4626,8 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null, $offlin
}
// Check if user can view this category.
if (!has_capability('moodle/category:viewhiddencategories', $context)) {
$coursecatvisible = $DB->get_field('course_categories', 'visible', array('id' => $context->instanceid));
if (!$coursecatvisible) {
send_file_not_found();
}
if (!core_course_category::get($context->instanceid, IGNORE_MISSING)) {
send_file_not_found();
}
$filename = array_pop($args);