mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-35429 backup: Only show relevant actions for automated backups
- Users without permission to download or restore won't see the respective links. - The 'Manage backup files' button for the 'automated' backup filearea now requires the same permissions as downloading does for this filearea, those being 'restore:userinfo' and 'backup:downloadfile'.
This commit is contained in:
parent
54945fa728
commit
5bbea7338d
4 changed files with 119 additions and 13 deletions
|
@ -42,6 +42,9 @@ $url = new moodle_url('/backup/backupfilesedit.php', array('currentcontext'=>$cu
|
|||
|
||||
require_login($course, false, $cm);
|
||||
require_capability('moodle/restore:uploadfile', $context);
|
||||
if ($filearea == 'automated' && !can_download_from_backup_filearea($filearea, $context)) {
|
||||
throw new required_capability_exception($context, 'moodle/backup:downloadfile', 'nopermissions', '');
|
||||
}
|
||||
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_context($context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue