From 4cbe0af6fa74cb6d927332b7e60945874128cf20 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 0000000000..1849e5c2fc --- /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 c3a30e12ca..55a5ea8a7a 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 910375d470..02587d2f99 100644 --- a/internal/grpc/services/gateway/usershareprovider.go +++ b/internal/grpc/services/gateway/usershareprovider.go @@ -583,8 +583,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