restrict v1
This commit is contained in:
@@ -158,6 +158,20 @@ func AnswerFollowUp(ctx context.Context, pageUser *db.User, question *db.Questio
|
||||
return
|
||||
}
|
||||
|
||||
// 站方处置 L2 起拒绝回答追问:追问回答同样是公开内容,且没有「私密」这一档可以降级。
|
||||
restrictionLevel, _, err := db.Restrictions.ActiveLevel(ctx.Request().Context(), pageUser.ID)
|
||||
if err != nil {
|
||||
logrus.WithContext(ctx.Request().Context()).WithError(err).Error("Failed to query user restriction")
|
||||
ctx.SetInternalError()
|
||||
ctx.Success("question/item")
|
||||
return
|
||||
}
|
||||
if db.RestrictionAtLeast(restrictionLevel, db.RestrictionL2) {
|
||||
ctx.SetErrorFlash(i18n.T(ctx.Lang(), "question.errRestrictedPublish"))
|
||||
ctx.Success("question/item")
|
||||
return
|
||||
}
|
||||
|
||||
followUpID := uint(ctx.ParamInt("followUpID"))
|
||||
|
||||
// 内容安全检测:统一守卫,箱主本人回复同样按自己的审核严格度裁决。
|
||||
|
||||
Reference in New Issue
Block a user