Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/storage/pkg/decomposedfs/recycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,5 +475,6 @@ func (tb *DecomposedfsTrashbin) EmptyRecycle(ctx context.Context, ref *provider.
}

func (tb *DecomposedfsTrashbin) getRecycleRoot(spaceID string) string {
return filepath.Join(tb.fs.getSpaceRoot(spaceID), "trash")
rootNode := node.NewBaseNode(spaceID, spaceID, tb.fs.lu)
return filepath.Join(rootNode.InternalPath(), "trash")
}
7 changes: 1 addition & 6 deletions pkg/storage/pkg/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"github.com/opencloud-eu/reva/v2/pkg/rgrpc/status"
"github.com/opencloud-eu/reva/v2/pkg/rgrpc/todo/pool"
sdk "github.com/opencloud-eu/reva/v2/pkg/sdk/common"
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/lookup"
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/metadata/prefixes"
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/node"
"github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/permissions"
Expand Down Expand Up @@ -745,7 +744,7 @@ func (fs *Decomposedfs) DeleteStorageSpace(ctx context.Context, req *provider.De
return err
}

root := fs.getSpaceRoot(spaceID)
root := n.InternalPath()

// walkfn will delete the blob if the node has one
walkfn := func(path string, info os.FileInfo, err error) error {
Expand Down Expand Up @@ -1103,10 +1102,6 @@ func isGrantExpired(g *provider.Grant) bool {
return time.Now().After(time.Unix(int64(g.Expiration.Seconds), int64(g.Expiration.Nanos)))
}

func (fs *Decomposedfs) getSpaceRoot(spaceID string) string {
return filepath.Join(fs.o.Root, "spaces", lookup.Pathify(spaceID, 1, 2))
}

// Space deletion can be tricky as there are lots of different cases:
// - spaces of type personal can only be disabled and deleted by users with the "delete-all-home-spaces" permission
// - a user with the "delete-all-spaces" permission may delete but not enable/disable any project space
Expand Down