33a34,37 > // Check if we are marking a user complete via the completion report > $user = optional_param('user', 0, PARAM_INT); > $rolec = optional_param('rolec', 0, PARAM_INT); > 51c55,58 < throw new moodle_exception('nottracked', 'completion'); --- > $admin_user_is_marking = $rolec && is_enrolled(context_course::instance($courseid), $USER->id, 'moodle/course:markcomplete', true); > if (!$admin_user_is_marking) { > throw new moodle_exception('nottracked', 'completion'); > } 54,56c61 < // Check if we are marking a user complete via the completion report < $user = optional_param('user', 0, PARAM_INT); < $rolec = optional_param('rolec', 0, PARAM_INT); --- >