Skip to content
Browse files

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

  • Loading branch information...
1 parent 408612d commit bf8ff4889be7305d8eabe8a904f1534ad2139e29 @jennymgray jennymgray committed Mar 31, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/navigationlib.php
View
6 lib/navigationlib.php
@@ -1653,9 +1653,9 @@ 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) {
- $url = new moodle_url('/user/files.php');
+ $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 bf8ff48

Please sign in to comment.
Something went wrong with that request. Please try again.