feat: file copy, move and paste conflict checking

This commit is contained in:
Ramires Viana
2020-07-15 15:12:13 +00:00
parent 9a2ebbabe2
commit eed9da1471
8 changed files with 138 additions and 51 deletions

View File

@@ -148,6 +148,12 @@ var resourcePatchHandler = withUser(func(w http.ResponseWriter, r *http.Request,
return http.StatusForbidden, nil
}
if r.URL.Query().Get("override") != "true" {
if _, err := d.user.Fs.Stat(dst); err == nil {
return http.StatusConflict, nil
}
}
err = d.RunHook(func() error {
switch action {
// TODO: use enum