From: Nicolas Connault Date: Fri, 30 Oct 2009 07:26:11 +0000 (+0000) Subject: MDL-20328 New capabilities for blog X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=05de723b1be631fb0a86f3dfeb53f092822227c1;p=moodle.git MDL-20328 New capabilities for blog --- diff --git a/lib/db/access.php b/lib/db/access.php index ae0ae0466d..69009a61dd 100644 --- a/lib/db/access.php +++ b/lib/db/access.php @@ -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