MDL-20328 New capabilities for blog
authorNicolas Connault <nicolasconnault@gmail.com>
Fri, 30 Oct 2009 07:26:11 +0000 (07:26 +0000)
committerNicolas Connault <nicolasconnault@gmail.com>
Fri, 30 Oct 2009 07:26:11 +0000 (07:26 +0000)
lib/db/access.php

index ae0ae04..69009a6 100644 (file)
@@ -798,7 +798,20 @@ $moodle_capabilities = array(
     'moodle/blog:view' => array(
 
         'captype' => 'read',
-        'contextlevel' => CONTEXT_COURSE,
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'guest' => CAP_ALLOW,
+            'user' => CAP_ALLOW,
+            'student' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    ),
+
+    'moodle/blog:search' => array(
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
         'legacy' => array(
             'guest' => CAP_ALLOW,
             'user' => CAP_ALLOW,
@@ -809,6 +822,16 @@ $moodle_capabilities = array(
         )
     ),
 
+    'moodle/blog:viewdrafts' => array(
+
+        'riskbitmask' => RISK_PERSONAL,
+        'captype' => 'read',
+        'contextlevel' => CONTEXT_SYSTEM,
+        'legacy' => array(
+            'admin' => CAP_ALLOW
+        )
+    ),
+
     'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
 
         'riskbitmask' => RISK_SPAM,
@@ -826,14 +849,14 @@ $moodle_capabilities = array(
         'riskbitmask' => RISK_SPAM,
 
         'captype' => 'write',
-        'contextlevel' => CONTEXT_COURSE,
+        'contextlevel' => CONTEXT_SYSTEM,
         'legacy' => array(
             'teacher' => CAP_ALLOW,
             'editingteacher' => CAP_ALLOW,
             'admin' => CAP_ALLOW
         )
     ),
-    
+
     'moodle/blog:manageexternal' => array(
 
         'riskbitmask' => RISK_SPAM,
@@ -849,6 +872,31 @@ $moodle_capabilities = array(
         )
     ),
 
+    'moodle/blog:associatecourse' => array(
+
+        'captype' => 'write',
+        'contextlevel' => CONTEXT_COURSE,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'user' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    ),
+
+    'moodle/blog:associatemodule' => array(
+
+        'captype' => 'write',
+        'contextlevel' => CONTEXT_MODULE,
+        'legacy' => array(
+            'student' => CAP_ALLOW,
+            'user' => CAP_ALLOW,
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    ),
 
     'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only