mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
MDL-35429 restore: capability clarification for automated backups
- added relevant cap check on restorefile.php to improve the error message when attempting to restore automated backups. This cap is already responsible for controlling restores from automated areas. - Restored the 'viewautomatedfilearea' capabilities original lang string.
This commit is contained in:
parent
d8e9a23c48
commit
f2faf9fae6
@ -79,6 +79,9 @@ if (!check_dir_exists($tmpdir, true, true)) {
|
||||
|
||||
// choose the backup file from backup files tree
|
||||
if ($action == 'choosebackupfile') {
|
||||
if ($filearea == 'automated') {
|
||||
require_capability('moodle/restore:viewautomatedfilearea', $context);
|
||||
}
|
||||
if ($fileinfo = $browser->get_file_info($filecontext, $component, $filearea, $itemid, $filepath, $filename)) {
|
||||
if (is_a($fileinfo, 'file_info_stored')) {
|
||||
// Use the contenthash rather than copying the file where possible,
|
||||
|
@ -352,7 +352,7 @@ $string['restore:restoretargetimport'] = 'Restore from files targeted as import'
|
||||
$string['restore:rolldates'] = 'Allowed to roll activity configuration dates on restore';
|
||||
$string['restore:uploadfile'] = 'Upload files to backup areas';
|
||||
$string['restore:userinfo'] = 'Restore user data';
|
||||
$string['restore:viewautomatedfilearea'] = 'View automated backup area';
|
||||
$string['restore:viewautomatedfilearea'] = 'Restore courses from automated backups';
|
||||
$string['risks'] = 'Risks';
|
||||
$string['roleallowheader'] = 'Allow role:';
|
||||
$string['roleallowinfo'] = 'Select a role to be added to the list of allowed roles in context "{$a->context}", capability "{$a->cap}":';
|
||||
|
Loading…
x
Reference in New Issue
Block a user