Merge branch 'wip-MDL-25651' of git://github.com/jennymgray/moodle
authorPetr Skoda <commits@skodak.org>
Mon, 4 Apr 2011 07:55:41 +0000 (09:55 +0200)
committerPetr Skoda <commits@skodak.org>
Mon, 4 Apr 2011 07:55:41 +0000 (09:55 +0200)
lib/navigationlib.php

index 6824ee6..4434d7c 100644 (file)
@@ -1653,8 +1653,8 @@ class global_navigation extends navigation_node {
             $usernode->add(get_string('messages', 'message'), $url, self::TYPE_SETTING, null, 'messages');
         }
 
-        // TODO: Private file capability check
-        if ($iscurrentuser) {
+        $context = get_context_instance(CONTEXT_USER, $USER->id);
+        if ($iscurrentuser && has_capability('moodle/user:manageownfiles', $context)) {
             $url = new moodle_url('/user/files.php');
             $usernode->add(get_string('myfiles'), $url, self::TYPE_SETTING);
         }