(username string, role int)
| 15 | ) |
| 16 | |
| 17 | func validUserInfo(username string, role int) bool { |
| 18 | // check username is empty |
| 19 | if strings.TrimSpace(username) == "" { |
| 20 | return false |
| 21 | } |
| 22 | if !common.IsValidateRole(role) { |
| 23 | return false |
| 24 | } |
| 25 | return true |
| 26 | } |
| 27 | |
| 28 | func authHelper(c *gin.Context, minRole int) { |
| 29 | session := sessions.Default(c) |
no test coverage detected