From 009fca2bb4ceed57a62b02ef935273cf07358d2c Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Mon, 20 Dec 2010 17:19:25 +0800 Subject: [PATCH] category editing MDL-21671 MOODLE_19_STABLE check capability when parent category changed --- course/editcategory.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/course/editcategory.php b/course/editcategory.php index e0b940dc4be..cc384ce3a6c 100644 --- a/course/editcategory.php +++ b/course/editcategory.php @@ -61,6 +61,8 @@ if ($mform->is_cancelled()) { // Update an existing category. $newcategory->id = $category->id; if ($newcategory->parent != $category->parent) { + // check category manage capability if parent changed + require_capability('moodle/category:manage', get_category_or_system_context((int)$newcategory->parent)); $parent_cat = get_record('course_categories', 'id', $newcategory->parent); move_category($newcategory, $parent_cat); }