MDL-68974 blocks: Check permission before generating content

This commit is contained in:
Andrew Nicols
2020-09-03 17:21:37 +02:00
committed by Jenkins
parent 9aa9e5f1e6
commit 5b0902eb06
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -1260,6 +1260,12 @@ class block_manager {
*/
public function ensure_content_created($region, $output) {
$this->ensure_instances_exist($region);
if (!has_capability('moodle/block:view', $this->page->context) ) {
$this->visibleblockcontent[$region] = [];
return;
}
if (!array_key_exists($region, $this->visibleblockcontent)) {
$contents = array();
if (array_key_exists($region, $this->extracontent)) {