Don't display hidden live
This commit is contained in:
parent
4f13efbab1
commit
b16c91ac6d
5 changed files with 8 additions and 8 deletions
|
@ -33,7 +33,7 @@ func declareAPIAuthQuestionsRoutes(router *gin.RouterGroup) {
|
|||
c.JSON(http.StatusOK, questions)
|
||||
}
|
||||
} else {
|
||||
if !s.Shown && !u.IsAdmin {
|
||||
if (!s.Shown || s.Direct != nil) && !u.IsAdmin {
|
||||
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"errmsg": "Not accessible"})
|
||||
return
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ func declareAPIAuthQuestionsRoutes(router *gin.RouterGroup) {
|
|||
return
|
||||
}
|
||||
|
||||
if !(s.Shown || (s.Direct != nil && *s.Direct == q.Id)) {
|
||||
if !s.Shown || (s.Direct != nil && *s.Direct != q.Id) {
|
||||
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"errmsg": "Not authorized"})
|
||||
return
|
||||
}
|
||||
|
|
Reference in a new issue