Skip to content

Commit

Permalink
Merge pull request #4388 from rhafer/fix-update-usershare
Browse files Browse the repository at this point in the history
Fix UpdateUserShare when just the expiration date is updated
  • Loading branch information
micbar committed Dec 5, 2023
2 parents b9486a8 + 1fbdbbb commit c3c250c
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
@@ -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/4388
6 changes: 3 additions & 3 deletions internal/grpc/services/gateway/usershareprovider.go
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 c3c250c

Please sign in to comment.