feat: file copy, move and paste conflict checking

This commit is contained in:
Ramires Viana committed 2020-07-17 12:37:52 +00:00
1 parent 9a2ebbabe2
commit eed9da1471
8 files changed
+138 -51

No files matched your search

+6
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