From 35e7a12c0d7c91b0d67d68f9199427fba8ad4b39 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 | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) 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 c3a30e12ca5..55a5ea8a7a5 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 910375d4704..cc2f0ac65ab 100644 --- a/internal/grpc/services/gateway/usershareprovider.go +++ b/internal/grpc/services/gateway/usershareprovider.go @@ -583,7 +583,7 @@ 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 { + (req.GetResourceInfo().GetSpace().GetSpaceType() == _spaceTypePersonal || req.GetResourceInfo().GetSpace().GetSpaceType() == _spaceTypeVirtual) { return nil, errors.New("gateway: space type is not eligible for sharing") } // If the share is a denial we call denyGrant instead.