-
Bug
-
Resolution: Fixed
-
Major
-
2.1.3
-
MOODLE_21_STABLE
-
MOODLE_21_STABLE, MOODLE_22_STABLE
-
w51_
MDL-30697_m23_roleslink -
In /course/lib.php, line 3177, there is the output for the "assign role" button which will be shown in a course in editing mode near every activity:
if (has_capability('moodle/course:managegroups', $modcontext)){
|
$context = get_context_instance(CONTEXT_MODULE, $mod->id);
|
$assign = '<a class="editing_assign" title="'.$str->assign.'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.
|
$context->id.'"><img src="'.$OUTPUT->pix_url('i/roles') . '" alt="'.$str->assign.'" class="iconsmall"/></a>';
|
} else {
|
$assign = '';
|
}
|
I think the capability check is wrong as this button has nothing to do with groups. Shouldn't it be:
if (has_capability('moodle/role:assign', $modcontext)){
|
$context = get_context_instance(CONTEXT_MODULE, $mod->id);
|
$assign = '<a class="editing_assign" title="'.$str->assign.'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.
|
$context->id.'"><img src="'.$OUTPUT->pix_url('i/roles') . '" alt="'.$str->assign.'" class="iconsmall"/></a>';
|
} else {
|
$assign = '';
|
}
|
?
- has a non-specific relationship to
-
MDL-30787 review and fix use of capabilities for edit actions on main course page
-
- Closed
-