mirror of
https://github.com/moodle/moodle.git
synced 2025-05-02 14:28:30 +02:00
MDL-68974 blocks: Check permission before generating content
This commit is contained in:
parent
cb72d845f5
commit
5c91f31d2e
@ -1281,6 +1281,9 @@ class calendar_information {
|
||||
* @param string|null $view preference view options (eg: day, month, upcoming)
|
||||
*/
|
||||
public function add_sidecalendar_blocks(core_calendar_renderer $renderer, $showfilters=false, $view=null) {
|
||||
if (!has_capability('moodle/block:view', $this->context) ) {
|
||||
return;
|
||||
}
|
||||
if ($showfilters) {
|
||||
$filters = new block_contents();
|
||||
$filters->content = $renderer->event_filter();
|
||||
|
@ -1225,6 +1225,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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user