mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-10573 - moodle/block:view wasn't working with switch roles or block_list class
This commit is contained in:
parent
58a0097f39
commit
25a7d98066
@ -689,6 +689,13 @@ class block_list extends block_base {
|
||||
var $content_type = BLOCK_TYPE_LIST;
|
||||
|
||||
function is_empty() {
|
||||
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
|
||||
if ( !has_capability('moodle/block:view', $context) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->get_content();
|
||||
return (empty($this->content->items) && empty($this->content->footer));
|
||||
}
|
||||
|
@ -1153,7 +1153,11 @@ $moodle_capabilities = array(
|
||||
'contextlevel' => CONTEXT_BLOCK,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_ALLOW,
|
||||
'user' => CAP_ALLOW
|
||||
'user' => CAP_ALLOW,
|
||||
'student' => CAP_ALLOW,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'coursecreator' => CAP_ALLOW
|
||||
)
|
||||
)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user