Permalink
Browse files

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.
  • Loading branch information...
1 parent 0d9a2ce commit 1b68e51133ceca6e2a906bded0b558a73ff0b7b0 @damyon damyon committed Apr 11, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 course/category.php
View
@@ -61,6 +61,12 @@
// 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) {

0 comments on commit 1b68e51

Please sign in to comment.