db: Add a published attribute, filled by challenge.txt

This commit is contained in:
nemunaire 2022-10-31 18:52:29 +01:00
commit a28f108b8a
7 changed files with 75 additions and 19 deletions

View file

@ -152,7 +152,9 @@ func (t *Team) HasAccess(e *Exercice) bool {
// CanDownload checks if the Team has access to the given file.
func (t *Team) CanDownload(f *EFile) bool {
if deps, err := f.GetDepends(); err != nil {
if !f.Published {
return false
} else if deps, err := f.GetDepends(); err != nil {
log.Printf("Unable to retrieve file dependencies: %s\n", err)
return false
} else {