]> git.mjollnir.org Git - moodle.git/commitdiff
Prevent admin tree to be showed for non-admins in 'my' page. MDL-14225 ; merged from...
authorstronk7 <stronk7>
Sun, 27 Apr 2008 00:32:00 +0000 (00:32 +0000)
committerstronk7 <stronk7>
Sun, 27 Apr 2008 00:32:00 +0000 (00:32 +0000)
blocks/admin_tree/block_admin_tree.php

index 1d694532af0dfdfd265e5a963256ac998cd25c5c..f05bdb937568ab946674277d175c8da4d93d5fe0 100644 (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() {