Skip to content

Commit

Permalink
Set the owner on the stat response to the share jail
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Jul 4, 2022
1 parent d6ac392 commit 6d40788
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
"github.com/cs3org/reva/v2/pkg/appctx"
ctxpkg "github.com/cs3org/reva/v2/pkg/ctx"
"github.com/cs3org/reva/v2/pkg/errtypes"
"github.com/cs3org/reva/v2/pkg/rgrpc"
"github.com/cs3org/reva/v2/pkg/rgrpc/status"
Expand Down Expand Up @@ -662,6 +663,10 @@ func (s *service) Stat(ctx context.Context, req *provider.StatRequest) (*provide
}

if isVirtualRoot(req.Ref) {
owner, ok := ctxpkg.ContextGetUser(ctx)
if !ok {
return nil, fmt.Errorf("missing user in context")
}
receivedShares, shareMd, err := s.fetchShares(ctx)
if err != nil {
return nil, err
Expand Down Expand Up @@ -690,7 +695,8 @@ func (s *service) Stat(ctx context.Context, req *provider.StatRequest) (*provide
PermissionSet: &provider.ResourcePermissions{
// TODO
},
Etag: shareMd[earliestShare.Id.OpaqueId].ETag,
Etag: shareMd[earliestShare.Id.OpaqueId].ETag,
Owner: owner.Id,
},
}, nil
}
Expand Down

0 comments on commit 6d40788

Please sign in to comment.