-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[full-ci] fix an error when lock/unlock a file #4518
Conversation
28b921c
to
aeac7ea
Compare
shouldn't this be handled in the // SetLock puts a lock on the given reference
func (s *service) SetLock(ctx context.Context, req *provider.SetLockRequest) (*provider.SetLockResponse, error) {
err := s.storage.SetLock(ctx, req.Ref, req.Lock)
return &provider.SetLockResponse{
Status: status.NewStatusFromErrType(ctx, "set lock", err),
}, nil
}
// GetLock returns an existing lock on the given reference
func (s *service) GetLock(ctx context.Context, req *provider.GetLockRequest) (*provider.GetLockResponse, error) {
lock, err := s.storage.GetLock(ctx, req.Ref)
return &provider.GetLockResponse{
Status: status.NewStatusFromErrType(ctx, "get lock", err),
Lock: lock,
}, nil
}
// RefreshLock refreshes an existing lock on the given reference
func (s *service) RefreshLock(ctx context.Context, req *provider.RefreshLockRequest) (*provider.RefreshLockResponse, error) {
err := s.storage.RefreshLock(ctx, req.Ref, req.Lock, req.ExistingLockId)
return &provider.RefreshLockResponse{
Status: status.NewStatusFromErrType(ctx, "refresh lock", err),
}, nil
}
// Unlock removes an existing lock from the given reference
func (s *service) Unlock(ctx context.Context, req *provider.UnlockRequest) (*provider.UnlockResponse, error) {
err := s.storage.Unlock(ctx, req.Ref, req.Lock)
return &provider.UnlockResponse{
Status: status.NewStatusFromErrType(ctx, "unlock", err),
}, nil
} If we only check the current users public share role on the HTTP API this will still be possible on the CS3 API. |
It's a fair point |
5e2acf6
to
219ec22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The switch should be extended and the errors should all be from the errors package.
960dc70
to
5baf636
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no failing tests? wow! but we should do an ocis bump full test run to verify ;-)
5baf636
to
88863f6
Compare
88863f6
to
f6f2854
Compare
* [full-ci] fix an error when lock/unlock a public shared file * added errtype to http code mapping * reworked the error handling --------- Co-authored-by: Roman Perekhod <[email protected]> (cherry picked from commit 9da2e18)
* [full-ci] fix an error when lock/unlock a public shared file * added errtype to http code mapping * reworked the error handling --------- Co-authored-by: Roman Perekhod <[email protected]> (cherry picked from commit 9da2e18)
Description:
We fixed a bug when anonymous user with viewer role in public link of a folder can lock/unlock a file inside it
Related issue:
owncloud/ocis#7785
owncloud/ocis#7761
Related PR:
owncloud/ocis#8472