MDL-10965 courses: capability to browse course list
This commit is contained in:
+2
-5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user