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.
This commit is contained in:
Damyon Wiese
2013-04-11 14:07:46 +08:00
parent 0d9a2ce8e0
commit 1b68e51133
+6
View File
@@ -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) {