Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[full-ci] disallow to share the personal drive #4559

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-graph-invite.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions internal/grpc/services/gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ import (
"google.golang.org/grpc"
)

const (
_spaceTypePersonal = "personal"
_spaceTypeProject = "project"
)

func init() {
rgrpc.Register("gateway", New)
}
Expand Down
4 changes: 4 additions & 0 deletions internal/grpc/services/gateway/usershareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading