backend: check the team has access to the exercice/flag before doing the action
This commit is contained in:
parent
ff7c89af9f
commit
15d108497e
4 changed files with 29 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Reference in a new issue