]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15768 - added general capability for exporting any content to portfolio
authormjollnir_ <mjollnir_>
Tue, 12 Aug 2008 13:31:02 +0000 (13:31 +0000)
committermjollnir_ <mjollnir_>
Tue, 12 Aug 2008 13:31:02 +0000 (13:31 +0000)
lang/en_utf8/role.php
lib/db/access.php
user/tabs.php
version.php

index f2d99f49ef0821524099cc9701800ab92d5acdc0..2f6ba30357c609566b8b408fa24cf16b98b2b2b9 100644 (file)
@@ -103,6 +103,7 @@ $string['overriderolesin'] = 'Override roles in $a';
 $string['overrides'] = 'Overrides';
 $string['permissions'] = 'Permissions';
 $string['potentialusers'] = '$a potential users';
+$string['portfolio:export'] = 'Export to portfolios';
 $string['prevent'] = 'Prevent';
 $string['prohibit'] = 'Prohibit';
 $string['question:add'] = 'Add new questions';
index aa12f54ff7bc565e5f8b37f500f72a2f41f174a6..c894b9237b50531084880502d237e5dd078dbd05 100644 (file)
@@ -1273,6 +1273,18 @@ $moodle_capabilities = array(
             'editingteacher' => CAP_ALLOW,
             'coursecreator' => CAP_ALLOW
         )
+    ),
+
+    'moodle/portfolio:export' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'user' => CAP_ALLOW,
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'coursecreator' => CAP_ALLOW
+        )
     )
 );
 
index d72497c3824b367a05754b3f0963731fad6c9762..c993594b2e6257464dbdc0aeba924fdafa6652bd 100644 (file)
         }
     }
 
-    if (empty($userindexpage) && $user->id == $USER->id && !empty($CFG->portfolioenabled)) {
+    if (empty($userindexpage) && $user->id == $USER->id && !empty($CFG->portfolioenabled) && has_capability('moodle/portfolio:export', get_system_context())) {
 
         /// Portfolio tab
         require_once($CFG->libdir . '/portfoliolib.php');
         if (portfolio_instances(true, false)) {
-            // @todo penny permissions check?
             $toprow[] = new tabobject('portfolios', $CFG->wwwroot .'/user/portfolio.php', get_string('portfolios', 'portfolio'));
         }
     }
index 4c2b093e64dbf482128d49ba15ce6e10ae87a78c..76ac5411da3b0109f09dbd6e4b2ea7e812ec7af0 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 = 2008080701;  // YYYYMMDD   = date of the last version bump
+    $version = 2008081200;  // YYYYMMDD   = date of the last version bump
                             //         XX = daily increments
 
     $release = '2.0 dev (Build: 20080812)';  // Human-friendly version name