MDL-21668 backup - New capabilities creation
authorEloy Lafuente <stronk7@moodle.org>
Sat, 1 May 2010 16:42:29 +0000 (16:42 +0000)
committerEloy Lafuente <stronk7@moodle.org>
Sat, 1 May 2010 16:42:29 +0000 (16:42 +0000)
lang/en/role.php
lib/db/access.php
version.php

index 4e950c6..036ac1c 100644 (file)
@@ -55,8 +55,14 @@ $string['assignroles'] = 'Assign roles';
 $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';
@@ -253,8 +259,12 @@ $string['resetrole'] = 'Reset to defaults';
 $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';
index defcc33..df29ea0 100644 (file)
@@ -88,6 +88,62 @@ $capabilities = array(
         '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,
@@ -102,6 +158,18 @@ $capabilities = array(
         '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,
@@ -113,6 +181,17 @@ $capabilities = array(
         )
     ),
 
+    '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,
@@ -127,6 +206,48 @@ $capabilities = array(
         '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,
@@ -155,34 +276,46 @@ $capabilities = array(
         '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
         )
     ),
index 27ce4f7..669f2a8 100644 (file)
@@ -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