MDL-27619: Prevent teachers from turning course Outcomes into site-wide ones

Similar to the issue which allowed teachers to create site-wide scales by editing a course-specific scale (MDL-24682), teachers could also promote a course-specific scale to a site-wide (standard) by editing it.  As with MDL-24682, removing the course ID check (leaving just the capability check) prevents this unauthorised creation of site-wide (standard) outcomes.
This commit is contained in:
Paul Nicholls 2012-08-13 12:38:42 +12:00
parent f42c34a38a
commit 11c56e2489

View file

@ -121,7 +121,7 @@ class edit_outcome_form extends moodleform {
if (empty($courseid)) {
$mform->hardFreeze('standard');
} else if (empty($outcome->courseid) and !has_capability('moodle/grade:manage', context_system::instance())) {
} else if (!has_capability('moodle/grade:manage', context_system::instance())) {
$mform->hardFreeze('standard');
} else if ($coursecount and empty($outcome->courseid)) {