feat: add permission-aware file copy and move
This commit is contained in:
@@ -147,6 +147,14 @@ func (m Multi) RootName(r Local) string {
|
||||
}
|
||||
return "root"
|
||||
}
|
||||
func (m Multi) Copy(a, b string) error {
|
||||
ra, aa, oka := m.find(a)
|
||||
rb, bb, okb := m.find(b)
|
||||
if !oka || !okb || aa == "" || bb == "" || ra.Root != rb.Root {
|
||||
return os.ErrInvalid
|
||||
}
|
||||
return ra.Copy(aa, bb)
|
||||
}
|
||||
func (m Multi) Rename(a, b string) error {
|
||||
ra, aa, oka := m.find(a)
|
||||
rb, bb, okb := m.find(b)
|
||||
|
||||
Reference in New Issue
Block a user