Merge branch 'MDL-36141' of https://github.com/merrill-oakland/moodle
This commit is contained in:
@@ -35,7 +35,7 @@ $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
|
||||
$context = context_course::instance($course->id, MUST_EXIST);
|
||||
|
||||
require_login($course);
|
||||
require_capability('moodle/role:assign', $context);
|
||||
require_capability('moodle/course:reviewotherusers', $context);
|
||||
|
||||
if ($course->id == SITEID) {
|
||||
redirect("$CFG->wwwroot/");
|
||||
|
||||
@@ -144,6 +144,7 @@ $string['course:movesections'] = 'Move sections';
|
||||
$string['course:publish'] = 'Publish a course into hub';
|
||||
$string['course:request'] = 'Request new courses';
|
||||
$string['course:reset'] = 'Reset course';
|
||||
$string['course:reviewotherusers'] = 'Review other users';
|
||||
$string['course:sectionvisibility'] = 'Control section visibility';
|
||||
$string['course:setcurrentsection'] = 'Set current section';
|
||||
$string['course:update'] = 'Update course settings';
|
||||
|
||||
@@ -813,6 +813,17 @@ $capabilities = array(
|
||||
)
|
||||
),
|
||||
|
||||
'moodle/course:reviewotherusers' => array(
|
||||
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'archetypes' => array(
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'manager' => CAP_ALLOW,
|
||||
),
|
||||
'clonepermissionsfrom' => 'moodle/role:assign'
|
||||
),
|
||||
|
||||
'moodle/course:bulkmessaging' => array(
|
||||
|
||||
'riskbitmask' => RISK_SPAM,
|
||||
|
||||
+1
-1
@@ -461,7 +461,7 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
|
||||
// Deal somehow with users that are not enrolled but still got a role somehow
|
||||
if ($course->id != SITEID) {
|
||||
//TODO, create some new UI for role assignments at course level
|
||||
if (has_capability('moodle/role:assign', $coursecontext)) {
|
||||
if (has_capability('moodle/course:reviewotherusers', $coursecontext)) {
|
||||
$url = new moodle_url('/enrol/otherusers.php', array('id'=>$course->id));
|
||||
$usersnode->add(get_string('notenrolledusers', 'enrol'), $url, navigation_node::TYPE_SETTING, null, 'otherusers', new pix_icon('i/assignroles', ''));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user