Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix space name when listing personal spaces #2196

Merged
merged 1 commit into from
Oct 22, 2021
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
1 change: 1 addition & 0 deletions changelog/unreleased/update-storage-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Added the UpdateStorageSpace method to the decomposedfs.

https://github.com/cs3org/reva/pull/2162
https://github.com/cs3org/reva/pull/2195
https://github.com/cs3org/reva/pull/2196
17 changes: 5 additions & 12 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, node *node.Nod

// TODO apply more filters

sname, err := xattr.Get(node.InternalPath(), xattrs.SpaceNameAttr)
if err != nil {
return nil, err
}
space := &provider.StorageSpace{
// FIXME the driver should know its id move setting the spaceid from the storage provider to the drivers
//Id: &provider.StorageSpaceId{OpaqueId: "1284d238-aa92-42ce-bdc4-0b0000009157!" + n.ID},
Expand All @@ -334,22 +338,11 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, node *node.Nod
//StorageId: "1284d238-aa92-42ce-bdc4-0b0000009157",
OpaqueId: node.ID,
},
Name: node.Name,
Name: string(sname),
SpaceType: spaceType,
// Mtime is set either as node.tmtime or as fi.mtime below
}

switch space.SpaceType {
case "project":
sname, err := xattr.Get(node.InternalPath(), xattrs.SpaceNameAttr)
if err != nil {
return nil, err
}
space.Name = string(sname)
default:
space.Name = "root"
}

user := ctxpkg.ContextMustGetUser(ctx)

// filter out spaces user cannot access (currently based on stat permission)
Expand Down