Skip to content

Commit

Permalink
feat: deleting folders is not allowed (close #6933)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Aug 4, 2024
1 parent 81258d3 commit 2e4265a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/op/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@ func Remove(ctx context.Context, storage driver.Driver, path string) error {
if storage.Config().CheckStatus && storage.GetStorage().Status != WORK {
return errors.Errorf("storage not init: %s", storage.GetStorage().Status)
}
if utils.PathEqual(path, "/") {
return errors.New("delete root folder is not allowed, please goto the manage page to delete the storage instead")
}
path = utils.FixAndCleanPath(path)
rawObj, err := Get(ctx, storage, path)
if err != nil {
Expand Down

0 comments on commit 2e4265a

Please sign in to comment.