From 932d87f841f8d7dba1d71cc2fed01151860ab35b Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 11 Apr 2013 14:07:46 +0800 Subject: [PATCH] MDL-35144 Categories - Allow editing by custom roles Users with category:manage or course:create should be able to edit the course/category.php page. --- course/category.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/course/category.php b/course/category.php index 6ede36b4768..88ba4bf8ee9 100644 --- a/course/category.php +++ b/course/category.php @@ -61,6 +61,12 @@ $context = $PAGE->context; // And the object has been loaded for us no need for another DB call $category = $PAGE->category; +// This needs to match caps checked in can_edit_in_category below. +$PAGE->set_other_editing_capability(array( + 'moodle/category:manage', + 'moodle/course:create' +)); + $canedit = can_edit_in_category($category->id); if ($canedit) { if ($categoryedit !== -1) {