Skip to content

Commit

Permalink
Fix UpdateUserShare when just the expiration date is update
Browse files Browse the repository at this point in the history
When updating the Grant we need to use the Share as returned in the UpdateUserShareResponse.
The Share from the incoming request might just contain a subset of the attributes.
  • Loading branch information
rhafer committed Dec 5, 2023
1 parent b9486a8 commit 83fe141
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-update-userhare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Allow UpdateUserShare() to update just the expiration date

The UpdateUserShare Request now works if it just contains an update of the
expiration date.

https://github.com/cs3org/reva/pull/xxxx
6 changes: 3 additions & 3 deletions internal/grpc/services/gateway/usershareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ func (s *svc) updateShare(ctx context.Context, req *collaboration.UpdateShareReq
if s.c.CommitShareToStorageGrant {
creator := ctxpkg.ContextMustGetUser(ctx)
grant := &provider.Grant{
Grantee: req.GetShare().GetGrantee(),
Permissions: req.GetShare().GetPermissions().GetPermissions(),
Expiration: req.GetShare().GetExpiration(),
Grantee: res.GetShare().GetGrantee(),
Permissions: res.GetShare().GetPermissions().GetPermissions(),
Expiration: res.GetShare().GetExpiration(),
Creator: creator.GetId(),
}
updateGrantStatus, err := s.updateGrant(ctx, res.GetShare().GetResourceId(), grant, nil)
Expand Down

0 comments on commit 83fe141

Please sign in to comment.