Skip to content

Commit

Permalink
fix for #158
Browse files Browse the repository at this point in the history
  • Loading branch information
strangeman committed Feb 16, 2018
1 parent fe5dcdc commit 5e26bfb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/tasks/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ func GetTaskOutput(w http.ResponseWriter, r *http.Request) {

func RemoveTask(w http.ResponseWriter, r *http.Request) {
task := context.Get(r, "task").(db.Task)
editor := context.Get(r, "user").(*db.User)

if editor.Admin != true {
log.Warn(editor.Username + " doesn't permit task log deletion")
w.WriteHeader(http.StatusUnauthorized)
return
}

statements := []string{
"delete from task__output where task_id=?",
Expand Down

0 comments on commit 5e26bfb

Please sign in to comment.