Skip to content

Commit

Permalink
fix space name when listing personal spaces (#2196)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas authored Oct 22, 2021
1 parent 84a5191 commit 582ce36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
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

0 comments on commit 582ce36

Please sign in to comment.