public ActionResult CancelJob(int id /* scheduleTaskId */, string returnUrl = "") { if (!_permissionService.Authorize(StandardPermissionProvider.ManageScheduleTasks)) { return(AccessDeniedView()); } var cts = _taskScheduler.GetCancelTokenSourceFor(id); if (cts != null) { cts.Cancel(); NotifyWarning(T("Admin.System.ScheduleTasks.CancellationRequested")); } return(RedirectToReferrer(returnUrl)); }