mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
Prevent admin tree to be showed for non-admins in 'my' page. MDL-14225 ; merged from 19_STABLE
This commit is contained in:
parent
926c6aa9e3
commit
48acdf95be
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user