diff --git a/controllers/cohortdata.go b/controllers/cohortdata.go index b0b7ae1..7e0ba8c 100644 --- a/controllers/cohortdata.go +++ b/controllers/cohortdata.go @@ -52,7 +52,7 @@ func (u CohortDataController) RetrieveHistogramForCohortIdAndConceptId(c *gin.Co validAccessRequest := u.teamProjectAuthz.TeamProjectValidation(c, []int{cohortId}, cohortPairs) if !validAccessRequest { log.Printf("Error: invalid request") - c.JSON(http.StatusBadRequest, gin.H{"message": "access denied"}) + c.JSON(http.StatusForbidden, gin.H{"message": "access denied"}) c.Abort() return } @@ -101,7 +101,7 @@ func (u CohortDataController) RetrieveDataBySourceIdAndCohortIdAndVariables(c *g validAccessRequest := u.teamProjectAuthz.TeamProjectValidation(c, []int{cohortId}, cohortPairs) if !validAccessRequest { log.Printf("Error: invalid request") - c.JSON(http.StatusBadRequest, gin.H{"message": "access denied"}) + c.JSON(http.StatusForbidden, gin.H{"message": "access denied"}) c.Abort() return } @@ -254,7 +254,7 @@ func (u CohortDataController) RetrieveCohortOverlapStatsWithoutFilteringOnConcep validAccessRequest := u.teamProjectAuthz.TeamProjectValidation(c, []int{caseCohortId, controlCohortId}, cohortPairs) if !validAccessRequest { log.Printf("Error: invalid request") - c.JSON(http.StatusBadRequest, gin.H{"message": "access denied"}) + c.JSON(http.StatusForbidden, gin.H{"message": "access denied"}) c.Abort() return } diff --git a/controllers/concept.go b/controllers/concept.go index 78fd7d8..c32e603 100644 --- a/controllers/concept.go +++ b/controllers/concept.go @@ -102,7 +102,7 @@ func (u ConceptController) RetrieveBreakdownStatsBySourceIdAndCohortId(c *gin.Co validAccessRequest := u.teamProjectAuthz.TeamProjectValidationForCohort(c, cohortId) if !validAccessRequest { log.Printf("Error: invalid request") - c.JSON(http.StatusBadRequest, gin.H{"message": "access denied"}) + c.JSON(http.StatusForbidden, gin.H{"message": "access denied"}) c.Abort() return } @@ -135,7 +135,7 @@ func (u ConceptController) RetrieveBreakdownStatsBySourceIdAndCohortIdAndVariabl validAccessRequest := u.teamProjectAuthz.TeamProjectValidation(c, []int{cohortId}, cohortPairs) if !validAccessRequest { log.Printf("Error: invalid request") - c.JSON(http.StatusBadRequest, gin.H{"message": "access denied"}) + c.JSON(http.StatusForbidden, gin.H{"message": "access denied"}) c.Abort() return } @@ -201,7 +201,7 @@ func (u ConceptController) RetrieveAttritionTable(c *gin.Context) { validAccessRequest := u.teamProjectAuthz.TeamProjectValidation(c, []int{cohortId}, cohortPairs) if !validAccessRequest { log.Printf("Error: invalid request") - c.JSON(http.StatusBadRequest, gin.H{"message": "access denied"}) + c.JSON(http.StatusForbidden, gin.H{"message": "access denied"}) c.Abort() return }