public IActionResult GetProjectDailyReportByDate([FromBody] GetDailyReportByDateRequestModel request)
 {
     if (User.IsInRole("ROLE_ADMIN"))
     {
         return(new ObjectResult(this.projectDailyReportService.GetProjectDailyReportByDate(request, User.Identity.Name)));
     }
     else
     {
         var userId = User.FindFirst(ClaimTypes.Sid).Value;
         if (!this.projectInformationService.IsOwner(request.ProjectId, userId))
         {
             return(Forbid());
         }
         return(new ObjectResult(this.projectDailyReportService.GetProjectDailyReportByDate(request, User.Identity.Name)));
     }
 }
예제 #2
0
 public ProjectDailyReport GetProjectDailyReportByDate(GetDailyReportByDateRequestModel request, string userId)
 {
     return(((IProjectDailyReportRepository)this.genericRepository).GetProjectDailyReportByDate(request.ProjectId, request.Date, userId));
 }