backend: check the team has access to the exercice/flag before doing the action

This commit is contained in:
nemunaire 2019-02-05 03:24:52 +01:00
parent ff7c89af9f
commit 15d108497e
4 changed files with 29 additions and 5 deletions

View file

@ -43,6 +43,12 @@ func treatSubmission(pathname string, team fic.Team, exercice_id string) {
return
}
// Check the team can access this exercice
if !team.HasAccess(exercice) {
log.Println("[!!!] The team submits something for an exercice it doesn't have access yet")
return
}
// Find the corresponding theme
theme, err := fic.GetTheme(exercice.IdTheme)
if err != nil {