feat: refine minimal line icon file UI

This commit is contained in:
OpenClaw Agent
2026-09-22 02:29:31 +08:00
parent ba41474f0f
commit e3c7d8ecab
2 changed files with 15 additions and 9 deletions
+7 -1
View File
@@ -359,7 +359,7 @@ func (s *Server) transfer(w http.ResponseWriter, r *http.Request, copyOnly bool)
writeJSONError(w, http.StatusBadRequest, "invalid parameter")
return
}
if !a.MaskFor(src).HasRead() || !a.MaskFor(dst).HasWrite() || !a.MaskFor(path.Dir(dst)).HasWrite() {
if !a.MaskFor(src).HasRead() || (!copyOnly && !a.MaskFor(src).HasDelete()) || !a.MaskFor(dst).HasWrite() || !a.MaskFor(path.Dir(dst)).HasWrite() {
writeJSONError(w, http.StatusForbidden, "has no privilege")
return
}
@@ -384,6 +384,12 @@ func (s *Server) transfer(w http.ResponseWriter, r *http.Request, copyOnly bool)
writeJSONError(w, http.StatusForbidden, err.Error())
return
}
if !copyOnly {
if err = checkDeleteTree(s.Store, a, src); err != nil {
writeJSONError(w, http.StatusForbidden, err.Error())
return
}
}
}
if copyOnly {
err = s.Store.Copy(src, dst)