MDL-23302 Credit to Aparup. New cap moodle/user:manageownfiles to control private user files area

This commit is contained in:
Martin Dougiamas 2010-07-22 09:05:13 +00:00
parent a2580005a5
commit e4f413b4b3
4 changed files with 19 additions and 4 deletions

View file

@ -60,7 +60,9 @@ class block_private_files extends block_base {
$renderer = $this->page->get_renderer('block_private_files');
$this->content->text = $renderer->private_files_tree();
$this->content->text .= $OUTPUT->single_button(new moodle_url('/user/filesedit.php'), get_string('myfilesmanage'), 'get');
if (has_capability('moodle/user:manageownfiles', $this->context)) {
$this->content->text .= $OUTPUT->single_button(new moodle_url('/user/filesedit.php'), get_string('myfilesmanage'), 'get');
}
$this->content->footer = '';
}