Skip to content

Commit

Permalink
disallow to share the personal drive
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Mar 6, 2024
1 parent 84d1066 commit afc0755
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
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

0 comments on commit afc0755

Please sign in to comment.