mirror of https://gitee.com/answerdev/answer.git
feat: No operation is allowed when the reputation requirement is less than 0
This commit is contained in:
parent
ee7428cba5
commit
645df9d20f
|
@ -162,10 +162,9 @@ func (rs *RankService) checkUserRank(ctx context.Context, userID string, userRan
|
|||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
currentUserRank := userRank
|
||||
if currentUserRank < requireRank {
|
||||
if userRank < requireRank || requireRank < 0 {
|
||||
log.Debugf("user %s want to do action %s, but rank %d < %d",
|
||||
userID, action, currentUserRank, requireRank)
|
||||
userID, action, userRank, requireRank)
|
||||
return false, nil
|
||||
}
|
||||
return true, nil
|
||||
|
|
Loading…
Reference in New Issue