New setting delegated_qa to store QA managers

This commit is contained in:
nemunaire 2023-07-25 09:04:31 +02:00
commit d2f409db7a
11 changed files with 148 additions and 20 deletions

View file

@ -12,8 +12,11 @@ func declareTodoRoutes(router *gin.RouterGroup) {
router.GET("/qa_exercices.json", getExerciceTested)
router.GET("/qa_mywork.json", getQAWork)
router.GET("/qa_myexercices.json", getQAView)
router.POST("/qa_my_exercices.json", addQAView)
router.GET("/qa_work.json", getQATodo)
}
func declareTodoManagerRoutes(router *gin.RouterGroup) {
router.POST("/qa_my_exercices.json", addQAView)
router.POST("/qa_work.json", createQATodo)
}
@ -122,13 +125,6 @@ func getQATodo(c *gin.Context) {
}
func createQATodo(c *gin.Context) {
ficteam := c.MustGet("LoggedUser").(string)
if ficteam != "nemunaire" {
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"errmsg": "Restricted"})
return
}
var ut fic.QATodo
if err := c.ShouldBindJSON(&ut); err != nil {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"errmsg": err.Error()})
@ -151,13 +147,6 @@ func createQATodo(c *gin.Context) {
}
func addQAView(c *gin.Context) {
ficteam := c.MustGet("LoggedUser").(string)
if ficteam != "nemunaire" {
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"errmsg": "Restricted"})
return
}
var ut fic.QATodo
if err := c.ShouldBindJSON(&ut); err != nil {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"errmsg": err.Error()})