diff --git a/changelog/unreleased/fix-graph-invite.md b/changelog/unreleased/fix-graph-invite.md new file mode 100644 index 0000000000..29169dd344 --- /dev/null +++ b/changelog/unreleased/fix-graph-invite.md @@ -0,0 +1,6 @@ +Bugfix: Fix graph drive invite + +We fixed the issue when sharing of personal drive is allowed via graph + +https://github.com/cs3org/reva/pull/4559 +https://github.com/owncloud/ocis/issues/8494 diff --git a/internal/grpc/services/gateway/gateway.go b/internal/grpc/services/gateway/gateway.go index b8e6533da9..23bc84274a 100644 --- a/internal/grpc/services/gateway/gateway.go +++ b/internal/grpc/services/gateway/gateway.go @@ -35,6 +35,11 @@ import ( "google.golang.org/grpc" ) +const ( + _spaceTypePersonal = "personal" + _spaceTypeProject = "project" +) + func init() { rgrpc.Register("gateway", New) } diff --git a/internal/grpc/services/gateway/usershareprovider.go b/internal/grpc/services/gateway/usershareprovider.go index 9a27f8f9c5..ebfd5241dc 100644 --- a/internal/grpc/services/gateway/usershareprovider.go +++ b/internal/grpc/services/gateway/usershareprovider.go @@ -585,6 +585,10 @@ 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") + } // If the share is a denial we call denyGrant instead. var st *rpc.Status var err error