Prevent admin tree to be showed for non-admins in 'my' page. MDL-14225 ; merged from 19_STABLE

This commit is contained in:
stronk7 2008-04-27 00:32:00 +00:00
parent 926c6aa9e3
commit 48acdf95be

View File

@ -22,8 +22,11 @@ class block_admin_tree extends block_base {
}
function applicable_formats() {
//TODO: add 'my' only if user has role assigned in system or any course category context
return array('site' => true, 'admin' => true, 'my' => true);
if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
return array('site' => true, 'admin' => true, 'my' => true);
} else {
return array('site' => true, 'admin' => true);
}
}
function preferred_width() {