Permalink
Browse files

Merge branch 'wip-mdl-32155-m21' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_21_STABLE
  • Loading branch information...
danpoltawski committed May 23, 2012
2 parents 6e4bb45 + 38d13c2 commit 6645da5bce602237bce451b0525f2159643e36e6
Showing with 6 additions and 0 deletions.
  1. +6 −0 pluginfile.php
View
@@ -732,6 +732,12 @@
// 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;
}

0 comments on commit 6645da5

Please sign in to comment.