navigation MDL-25397 Converted use of can_edit_category to check capabilities instead.
authorSam Hemelryk <sam@moodle.com>
Fri, 26 Nov 2010 06:07:46 +0000 (06:07 +0000)
committerSam Hemelryk <sam@moodle.com>
Fri, 26 Nov 2010 06:07:46 +0000 (06:07 +0000)
lib/navigationlib.php

index 4a407e0..6b0f163 100644 (file)
@@ -3498,7 +3498,7 @@ class settings_navigation extends navigation_node {
         $categorynode = $this->add(print_context_name($this->context));
         $categorynode->force_open();
 
-        if (can_edit_in_category()) {
+        if (has_any_capability(array('moodle/category:manage', 'moodle/course:create'), $this->context)) {
             $url = new moodle_url('/course/category.php', array('id'=>$this->context->instanceid, 'sesskey'=>sesskey()));
             if ($this->page->user_is_editing()) {
                 $url->param('categoryedit', '0');