diff --git a/changelog/unreleased/user-expand-drive.md b/changelog/unreleased/user-expand-drive.md new file mode 100644 index 0000000000..ad1041d6b5 --- /dev/null +++ b/changelog/unreleased/user-expand-drive.md @@ -0,0 +1,5 @@ +Enhancement: Expand personal drive on the graph user + +We can now list the personal drive on the users endpoint via the graph API. A user can add an `$expand=drive` query to list the personal drive of the requested user. + +https://github.com/owncloud/ocis/pull/4357 diff --git a/go.mod b/go.mod index 6c7b7fc524..65ddfd3ca0 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/onsi/ginkgo/v2 v2.1.4 github.com/onsi/gomega v1.20.0 github.com/orcaman/concurrent-map v1.0.0 - github.com/owncloud/libre-graph-api-go v0.14.3 + github.com/owncloud/libre-graph-api-go v0.16.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 github.com/rs/zerolog v1.27.0 diff --git a/go.sum b/go.sum index 058ec9fbbb..652ae41def 100644 --- a/go.sum +++ b/go.sum @@ -973,6 +973,8 @@ github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CF github.com/ovh/go-ovh v1.1.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA= github.com/owncloud/libre-graph-api-go v0.14.3 h1:+lkIkLHjrLfazANYfg2MYEhaJsMXzfOjtIY1hF3PbU4= github.com/owncloud/libre-graph-api-go v0.14.3/go.mod h1:579sFrPP7aP24LZXGPopLfvE+hAka/2DYHk0+Ij+w+U= +github.com/owncloud/libre-graph-api-go v0.16.0 h1:CyW69/lREyx+nkUrXYJnMyshBygwkfPVCjm0ngqjcYs= +github.com/owncloud/libre-graph-api-go v0.16.0/go.mod h1:579sFrPP7aP24LZXGPopLfvE+hAka/2DYHk0+Ij+w+U= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= diff --git a/services/graph/pkg/service/v0/users.go b/services/graph/pkg/service/v0/users.go index 8d7bd51912..d96007597a 100644 --- a/services/graph/pkg/service/v0/users.go +++ b/services/graph/pkg/service/v0/users.go @@ -213,13 +213,13 @@ func (g Graph) GetUser(w http.ResponseWriter, r *http.Request) { d.Quota = quota if slices.Contains(sel, "drive") || slices.Contains(exp, "drive") { if *d.DriveType == "personal" { - drives = append(drives, *d) + user.Drive = d } } else { drives = append(drives, *d) + user.Drives = drives } } - user.Drives = drives } render.Status(r, http.StatusOK)