Permalink
Browse files

MDL-25651 add capability check to my private files navigation link

  • Loading branch information...
1 parent dae6b38 commit 52d1a8043c5e541c596c6537d42059b863c63c62 @jennymgray jennymgray committed Mar 31, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/navigationlib.php
@@ -1653,8 +1653,8 @@ protected function load_for_user($user=null, $forceforcontext=false) {
$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);
}

0 comments on commit 52d1a80

Please sign in to comment.