Skip to content

Commit

Permalink
MDL-21666 backup & restore caps - upload/download renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Feb 19, 2010
1 parent d294000 commit 2fdde5d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions lib/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
'clonepermissionsfrom' => 'moodle/site:backup'
),

'moodle/site:backupdownload' => array(
'moodle/backup:downloadfile' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

Expand All @@ -178,35 +178,35 @@
'admin' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/site:backup'
'clonepermissionsfrom' => 'moodle/site:backupdownload'
),

'moodle/site:backupupload' => array(
'moodle/backup:userinfo' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'riskbitmask' => RISK_PERSONAL,

'captype' => 'write',
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/site:restore'
)
),

'moodle/backup:userinfo' => array(
'moodle/restore:restorecourse' => array(

'riskbitmask' => RISK_PERSONAL,
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

'captype' => 'read',
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),

'clonepermissionsfrom' => 'moodle/site:restore'
),

'moodle/restore:restorecourse' => array(
'moodle/restore:uploadfile' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

Expand All @@ -217,7 +217,7 @@
'admin' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/site:restore'
'clonepermissionsfrom' => 'moodle/site:backupupload'
),

'moodle/restore:createuser' => array(
Expand Down
4 changes: 2 additions & 2 deletions lib/file/file_browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ private function get_file_info_course_backup($course, $context, $filearea=null,
}
}

$downloadable = has_capability('moodle/site:backupdownload', $context);
$uploadable = has_capability('moodle/site:backupupload', $context);
$downloadable = has_capability('moodle/backup:downloadfile', $context);
$uploadable = has_capability('moodle/backup:uploadfile', $context);
return new file_info_stored($this, $context, $storedfile, $urlbase, get_string('areabackup', 'repository'), false, $downloadable, $uploadable, false);

}
Expand Down
2 changes: 1 addition & 1 deletion pluginfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@

if ($filearea === 'course_backup') {
require_login($course);
require_capability('moodle/site:backupdownload', $context);
require_capability('moodle/backup:downloadfile', $context);

$relativepath = '/'.implode('/', $args);
$fullpath = $context->id.'course_backup0'.$relativepath;
Expand Down

0 comments on commit 2fdde5d

Please sign in to comment.