MDL-27735 Q&A forum: add new caps to add question. By default, teacher, editing teacher and manager role has the capability to add new question

This commit is contained in:
Rossiani Wijaya
2011-11-22 15:26:44 +08:00
parent 79b0fece1f
commit db8312d23c
4 changed files with 16 additions and 1 deletions
+12
View File
@@ -333,5 +333,17 @@ $capabilities = array(
'student' => CAP_ALLOW,
)
),
'mod/forum:addquestion' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
);
+1
View File
@@ -149,6 +149,7 @@ $string['exportdiscussion'] = 'Export whole discussion';
$string['forcessubscribe'] = 'This forum forces everyone to be subscribed';
$string['forum'] = 'Forum';
$string['forum:addnews'] = 'Add news';
$string['forum:addquestion'] = 'Add question';
$string['forumauthorhidden'] = 'Author (hidden)';
$string['forumblockingalmosttoomanyposts'] = 'You are approaching the posting threshold. You have posted {$a->numposts} times in the last {$a->blockperiod} and the limit is {$a->blockafter} posts.';
$string['forumbodyhidden'] = 'This post cannot be viewed by you, probably because you have not posted in the discussion or the maximum editing time hasn\'t passed yet.';
+2
View File
@@ -4824,6 +4824,8 @@ function forum_user_can_post_discussion($forum, $currentgroup=null, $unused=-1,
if ($forum->type == 'news') {
$capname = 'mod/forum:addnews';
} else if ($forum->type == 'qanda') {
$capname = 'mod/forum:addquestion';
} else {
$capname = 'mod/forum:startdiscussion';
}
+1 -1
View File
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();
$module->version = 2011110600;
$module->version = 2011110601;
$module->requires = 2011110200; // Requires this Moodle version
$module->cron = 60;
$module->component = 'mod_forum';