From a3d988262bb21be368ef144d940e2f23fb8eb6c4 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Tue, 12 Mar 2024 12:51:14 +0100 Subject: [PATCH] fix sharing invite on virtual drive --- changelog/unreleased/fix-graph-invite-virtual.md | 6 ++++++ internal/grpc/services/gateway/gateway.go | 1 + internal/grpc/services/gateway/usershareprovider.go | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/fix-graph-invite-virtual.md diff --git a/changelog/unreleased/fix-graph-invite-virtual.md b/changelog/unreleased/fix-graph-invite-virtual.md new file mode 100644 index 00000000000..1849e5c2fc6 --- /dev/null +++ b/changelog/unreleased/fix-graph-invite-virtual.md @@ -0,0 +1,6 @@ +Bugfix: Fix sharing invite on virtual drive + +We fixed the issue when sharing of virtual drive with other users was allowed + +https://github.com/cs3org/reva/pull/4568 +https://github.com/owncloud/ocis/issues/8495 diff --git a/internal/grpc/services/gateway/gateway.go b/internal/grpc/services/gateway/gateway.go index 23bc84274a7..d7da8cef0df 100644 --- a/internal/grpc/services/gateway/gateway.go +++ b/internal/grpc/services/gateway/gateway.go @@ -38,6 +38,7 @@ import ( const ( _spaceTypePersonal = "personal" _spaceTypeProject = "project" + _spaceTypeVirtual = "virtual" ) func init() { diff --git a/internal/grpc/services/gateway/usershareprovider.go b/internal/grpc/services/gateway/usershareprovider.go index ebfd5241dc4..e115db71291 100644 --- a/internal/grpc/services/gateway/usershareprovider.go +++ b/internal/grpc/services/gateway/usershareprovider.go @@ -586,8 +586,8 @@ func (s *svc) addShare(ctx context.Context, req *collaboration.CreateShareReques func (s *svc) addSpaceShare(ctx context.Context, req *collaboration.CreateShareRequest) (*collaboration.CreateShareResponse, error) { if refIsSpaceRoot(req.GetResourceInfo().GetId()) && - req.GetResourceInfo().GetSpace().GetSpaceType() == _spaceTypePersonal { - return nil, errors.New("gateway: space type is not eligible for sharing") + (req.GetResourceInfo().GetSpace().GetSpaceType() == _spaceTypePersonal || req.GetResourceInfo().GetSpace().GetSpaceType() == _spaceTypeVirtual) { + return &collaboration.CreateShareResponse{Status: status.NewInvalid(ctx, "space type is not eligible for sharing")}, nil } // If the share is a denial we call denyGrant instead. var st *rpc.Status