Skip to content

Commit

Permalink
MDL-21668 backup - New capabilities creation
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed May 1, 2010
1 parent d234faf commit 57ca97b
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 9 deletions.
10 changes: 10 additions & 0 deletions lang/en/role.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@
$string['assignrolesin'] = 'Assign roles in {$a}';
$string['assignrolesrelativetothisuser'] = 'Assign roles relative to this user';
$string['backtoallroles'] = 'Back to the list of all roles';
$string['backup:anonymise'] = 'Anonymise user data on backup';
$string['backup:backupactivity'] = 'Backup activities';
$string['backup:backupcourse'] = 'Backup courses';
$string['backup:backupsection'] = 'Backup sections';
$string['backup:configure'] = 'Configure backup options';
$string['backup:downloadfile'] = 'Download files from backup areas';
$string['backup:backuptargethub'] = 'Backup for hub';
$string['backup:backuptargetimport'] = 'Backup for import';
$string['backup:userinfo'] = 'Backup user data';
$string['block:edit'] = 'Edit a block\'s settings';
$string['block:view'] = 'View block';
Expand Down Expand Up @@ -253,8 +259,12 @@
$string['resetrolenolegacy'] = 'Clear permissions';
$string['resetrolesure'] = 'Are you sure that you want to reset role "{$a->name} ({$a->shortname})" to defaults?<p></p>The defaults are taken from the selected archetype ({$a->legacytype}).';
$string['resetrolesurenolegacy'] = 'Are you sure that you want to clear all permissions defined in this role "{$a->name} ({$a->shortname})"?';
$string['restore:configure'] = 'Configure restore options';
$string['restore:createuser'] = 'Create users on restore';
$string['restore:restoreactivity'] = 'Restore activities';
$string['restore:restoresection'] = 'Restore sections';
$string['restore:restorecourse'] = 'Restore courses';
$string['restore:restoretargethub'] = 'Restore from files targeted as hub';
$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';
Expand Down
149 changes: 141 additions & 8 deletions lib/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,62 @@
'clonepermissionsfrom' => 'moodle/site:backup'
),

'moodle/backup:backupsection' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

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

'clonepermissionsfrom' => 'moodle/backup:backupcourse'
),

'moodle/backup:backupactivity' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/backup:backupcourse'
),

'moodle/backup:backuptargethub' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

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

'clonepermissionsfrom' => 'moodle/backup:backupcourse'
),

'moodle/backup:backuptargetimport' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

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

'clonepermissionsfrom' => 'moodle/backup:backupcourse'
),

'moodle/backup:downloadfile' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
Expand All @@ -102,6 +158,18 @@
'clonepermissionsfrom' => 'moodle/site:backupdownload'
),

'moodle/backup:configure' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

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

'moodle/backup:userinfo' => array(

'riskbitmask' => RISK_PERSONAL,
Expand All @@ -113,6 +181,17 @@
)
),

'moodle/backup:anonymise' => array(

'riskbitmask' => RISK_PERSONAL,

'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'manager' => CAP_ALLOW
)
),

'moodle/restore:restorecourse' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
Expand All @@ -127,6 +206,48 @@
'clonepermissionsfrom' => 'moodle/site:restore'
),

'moodle/restore:restoresection' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

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

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

'moodle/restore:restoreactivity' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),

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

'moodle/restore:restoretargethub' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,

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

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

'moodle/restore:restoretargetimport' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
Expand Down Expand Up @@ -155,34 +276,46 @@
'clonepermissionsfrom' => 'moodle/site:backupupload'
),

'moodle/restore:userinfo' => array(
'moodle/restore:configure' => array(

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

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

'moodle/restore:createuser' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
'moodle/restore:rolldates' => array(

'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'coursecreator' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),

'moodle/restore:rolldates' => array(
'moodle/restore:userinfo' => array(

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

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'coursecreator' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),

'moodle/restore:createuser' => array(

'riskbitmask' => RISK_SPAM | RISK_PERSONAL,

'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'manager' => CAP_ALLOW
)
),
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)

$version = 2010043001; // YYYYMMDD = date of the last version bump
$version = 2010050100; // YYYYMMDD = date of the last version bump
// XX = daily increments

$release = '2.0 dev (Build: 20100501)'; // Human-friendly version name
Expand Down

0 comments on commit 57ca97b

Please sign in to comment.