MDL-45636 course_rest: changed modcontext to coursecontext
authorVirgil Ashruf <v.ashruf@avetica.nl>
Mon, 1 Sep 2014 10:36:04 +0000 (12:36 +0200)
committerVirgil Ashruf <v.ashruf@avetica.nl>
Mon, 1 Sep 2014 10:36:04 +0000 (12:36 +0200)
course/rest.php

index 1f7f8bc..eed9a3d 100644 (file)
@@ -108,9 +108,9 @@ switch($requestmethod) {
                         break;
 
                     case 'duplicate':
-                        require_capability('moodle/course:manageactivities', $modcontext);
-                        require_capability('moodle/backup:backuptargetimport', $modcontext);
-                        require_capability('moodle/restore:restoretargetimport', $modcontext);
+                        require_capability('moodle/course:manageactivities', $coursecontext);
+                        require_capability('moodle/backup:backuptargetimport', $coursecontext);
+                        require_capability('moodle/restore:restoretargetimport', $coursecontext);
                         if (!course_allowed_module($course, $cm->modname)) {
                             throw new moodle_exception('No permission to create that activity');
                         }