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:
@@ -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
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -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.';
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
Reference in New Issue
Block a user