Skip to content

Commit

Permalink
use user from context for webdav unlock request
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Mar 28, 2022
1 parent dfca59a commit 520f58b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/http/services/owncloud/ocdav/locks.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,13 @@ func (cls *cs3LS) Refresh(ctx context.Context, now time.Time, token string, dura
return LockDetails{}, errors.ErrNotImplemented
}
func (cls *cs3LS) Unlock(ctx context.Context, now time.Time, ref *provider.Reference, token string) error {
u := ctxpkg.ContextMustGetUser(ctx)

r := &provider.UnlockRequest{
Ref: ref,
Lock: &provider.Lock{
LockId: token, // can be a token or a Coded-URL
User: u.Id,
},
}
res, err := cls.client.Unlock(ctx, r)
Expand Down

0 comments on commit 520f58b

Please sign in to comment.