db: Add a published attribute, filled by challenge.txt
This commit is contained in:
parent
6b7ed273b7
commit
a28f108b8a
7 changed files with 75 additions and 19 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Reference in a new issue