From b668e7cc704d0f6d5b4e8766d1f0c9d3f335152d Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Mon, 3 Jun 2024 21:05:48 +0200 Subject: [PATCH] fixed the response code when the role/permission is empty on the share update --- changelog/unreleased/fix-share-update.md | 7 +++++++ .../owncloud/ocs/handlers/apps/sharing/shares/shares.go | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 changelog/unreleased/fix-share-update.md diff --git a/changelog/unreleased/fix-share-update.md b/changelog/unreleased/fix-share-update.md new file mode 100644 index 0000000000..b787190465 --- /dev/null +++ b/changelog/unreleased/fix-share-update.md @@ -0,0 +1,7 @@ +Bugfix: Fix share update + +We fixed the response code when the role/permission is empty on the share update + + +https://github.com/cs3org/reva/pull/4709 +https://github.com/owncloud/ocis/issues/8747 diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go index ef88c9acb8..b006d5d528 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go @@ -859,6 +859,9 @@ func (h *Handler) updateShare(w http.ResponseWriter, r *http.Request, share *col case rpc.Code_CODE_LOCKED: response.WriteOCSError(w, r, response.MetaLocked.StatusCode, uRes.GetStatus().GetMessage(), nil) return + case rpc.Code_CODE_INVALID_ARGUMENT, rpc.Code_CODE_FAILED_PRECONDITION: + response.WriteOCSError(w, r, response.MetaBadRequest.StatusCode, uRes.GetStatus().GetMessage(), nil) + return } response.WriteOCSError(w, r, response.MetaServerError.StatusCode, "grpc update share request failed", err) return