Skip to content

Commit

Permalink
MDL-25651 add capability check to my private files navigation link
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenny Gray committed Mar 31, 2011
1 parent dae6b38 commit 52d1a80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/navigationlib.php
Expand Up @@ -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);
}
Expand Down

0 comments on commit 52d1a80

Please sign in to comment.