Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
e0b4a480
Commit
e0b4a480
authored
Aug 10, 2020
by
Andrew Nicols
Committed by
Jenkins
Sep 03, 2020
Browse files
MDL-68974 blocks: Check permission before generating content
parent
b1157ac0
Changes
2
Hide whitespace changes
Inline
Side-by-side
calendar/lib.php
View file @
e0b4a480
...
...
@@ -1268,6 +1268,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
();
...
...
lib/blocklib.php
View file @
e0b4a480
...
...
@@ -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)) {
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment