diff --git a/internal/http/services/owncloud/ocgraph/drives.go b/internal/http/services/owncloud/ocgraph/drives.go index de40f388bf..791a1c6264 100644 --- a/internal/http/services/owncloud/ocgraph/drives.go +++ b/internal/http/services/owncloud/ocgraph/drives.go @@ -358,14 +358,21 @@ func cs3PermissionsToLibreGraph(user *userpb.User, perms *providerpb.ResourcePer case perms.Stat: p.SetRoles([]string{"viewer"}) } + + identity := &libregraph.Identity{ + DisplayName: user.DisplayName, + Id: &user.Id.OpaqueId, + } + p.GrantedToIdentities = []libregraph.IdentitySet{ { - User: &libregraph.Identity{ - DisplayName: user.DisplayName, - Id: &user.Id.OpaqueId, - }, + User: identity, }, } + + p.GrantedToV2 = &libregraph.SharePointIdentitySet{ + User: identity, + } return []libregraph.Permission{p} } diff --git a/internal/http/services/owncloud/ocgraph/ocgraph.go b/internal/http/services/owncloud/ocgraph/ocgraph.go index ce2525a8c6..61e297d789 100644 --- a/internal/http/services/owncloud/ocgraph/ocgraph.go +++ b/internal/http/services/owncloud/ocgraph/ocgraph.go @@ -71,6 +71,10 @@ func (s *svc) initRouter() { s.router.Route("/v1.0", func(r chi.Router) { r.Route("/me", func(r chi.Router) { r.Get("/", s.getMe) + }) + }) + s.router.Route("/v1beta1", func(r chi.Router) { + r.Route("/me", func(r chi.Router) { r.Route("/drives", func(r chi.Router) { r.Get("/", s.listMySpaces) @@ -79,8 +83,6 @@ func (s *svc) initRouter() { r.Route("/drives", func(r chi.Router) { r.Get("/{space-id}", s.getSpace) }) - }) - s.router.Route("/v1beta1", func(r chi.Router) { r.Route("/me/drive", func(r chi.Router) { r.Get("/sharedWithMe", s.getSharedWithMe) r.Get("/sharedByMe", s.getSharedByMe)