public Summary getLatestProjectSummary(int projectId, int year, int quarter) { bool rights = authRepo.getAdminRights() || authRepo.getTeamLeadRights(projectId); bool b = authRepo.getAccountRights(projectId); Debug.WriteLine("SummaryAuth " + b + " " + authRepo.getAdminRights() + " " + authRepo.getTeamLeadRights(projectId)); Summary summary = null; if (rights) { if (repo.getLatestProjectSummary(projectId, year, quarter) != null) { summary = repo.getLatestProjectSummary(projectId, year, quarter); } } else if (b) { if (repo.getLatestProjectSummary(projectId, year, quarter) != null) { summary = repo.getLatestProjectSummary(projectId, year, quarter); } } return(summary); }
public HttpResponseMessage getLatestProjectSummary(int projectId, int year, int quarter) { bool rights = authRepo.getAdminRights() || authRepo.getTeamLeadRights(projectId); bool b = authRepo.getAccountRights(projectId); Debug.WriteLine("SummaryAuth " + b + " " + authRepo.getAdminRights() + " " + authRepo.getTeamLeadRights(projectId)); Summary summary = null; summary = repo.getLatestProjectSummary(projectId, year, quarter); if (authRepo.isAuthorized(projectId)) { return(Request.CreateResponse(HttpStatusCode.OK, summary)); } else { return(Request.CreateResponse(HttpStatusCode.Forbidden)); } }