public async Task <IActionResult> GetAuthorInvitationByUserId(int userId) { if (userId == 0) { userId = Convert.ToInt32(HttpContext.User.FindFirstValue(ClaimTypes.NameIdentifier)); } if (!HttpContext.User.IsInRole("admin") && !_getAccessUser.UserCookieIs(HttpContext, Convert.ToString(userId))) { return(StatusCode(403, "Access Denied !")); } IEnumerable <ProjectInvitationData> result = await _projectGateway.GetAuthorInvitationByUserId(userId); if (result == null) { return(BadRequest("User has not send invitation to project")); } return(Ok(result)); }