From: stronk7 Date: Sun, 27 Apr 2008 00:32:00 +0000 (+0000) Subject: Prevent admin tree to be showed for non-admins in 'my' page. MDL-14225 ; merged from... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=48acdf95beac271523c726b9fe2d2609f58cc8a3;p=moodle.git Prevent admin tree to be showed for non-admins in 'my' page. MDL-14225 ; merged from 19_STABLE --- diff --git a/blocks/admin_tree/block_admin_tree.php b/blocks/admin_tree/block_admin_tree.php index 1d694532af..f05bdb9375 100644 --- a/blocks/admin_tree/block_admin_tree.php +++ b/blocks/admin_tree/block_admin_tree.php @@ -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() {