mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Merge branch 'wip-mdl-32155' of git://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
419c47c74a
1 changed files with 6 additions and 0 deletions
|
@ -4080,6 +4080,12 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) {
|
|||
// somebody tries to gain illegal access, cm type must match the component!
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
$bprecord = $DB->get_record('block_positions', array('blockinstanceid' => $context->instanceid), 'visible');
|
||||
// User can't access file, if block is hidden or doesn't have block:view capability
|
||||
if (($bprecord && !$bprecord->visible) || !has_capability('moodle/block:view', $context)) {
|
||||
send_file_not_found();
|
||||
}
|
||||
} else {
|
||||
$birecord = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue