public async Task <JsonResult> ApproveDoc([FromBody] TempModel model) { try { System.Security.Claims.ClaimsPrincipal currentUser = this.User; var role = currentUser.Claims.Where(x => x.Type == System.Security.Claims.ClaimTypes.Role).Select(x => x.Value); var userName = currentUser.Claims.Where(x => x.Type == "UserName").FirstOrDefault().Value; if (role.Contains("Approve") || role.Contains("Admin") || role.Contains("SuperAdmin")) { await _documentService.ApproveDocument(int.Parse(model.data), userName); return(Json(new { status = "success", message = "success !" })); } return(Json(new { status = "fail", message = " Duyệt không thành công! \n Không có quyền duyệt!" })); } catch (Exception e) { return(Json(new { status = "fail", message = e })); } }