예제 #1
0
        public async Task <IActionResult> DeleteDraft(AllArticlesViewModel model)
        {
            var userId = httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;

            if (ModelState.IsValid)
            {
                if (validationService.CheckDraftUserPermissions(userId, model.Id))
                {
                    editorService.DeleteDraft(model.Id);
                    return(RedirectToAction("AllDrafts"));
                }
            }

            return(RedirectToAction("NotPermitted"));
        }