Skip to content

Commit

Permalink
fix resource id in public shares (#2788)
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar authored Apr 27, 2022
1 parent bfdfc83 commit 8ff0830
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/public-ids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Return the correct file IDs on public link resources

Resources in public shares should return the real resourceids from the storage of the owner.

https://github.com/cs3org/reva/pull/2788
Original file line number Diff line number Diff line change
Expand Up @@ -740,17 +740,10 @@ func (s *service) augmentStatResponse(ctx context.Context, res *provider.StatRes
}

res.Info.Path = path.Join("/", sharePath)
s.setPublicStorageID(res.Info, tkn)
filterPermissions(res.Info.PermissionSet, share.GetPermissions().Permissions)
}
}

// setPublicStorageID encodes the actual spaceid and nodeid as an opaqueid in the publicstorageprovider space
func (s *service) setPublicStorageID(info *provider.ResourceInfo, shareToken string) {
info.Id.StorageId = utils.PublicStorageProviderID
info.Id.OpaqueId = shareToken
}

func addShare(i *provider.ResourceInfo, ls *link.PublicShare) error {
if i.Opaque == nil {
i.Opaque = &typesv1beta1.Opaque{}
Expand Down

0 comments on commit 8ff0830

Please sign in to comment.