diff --git a/changelog/unreleased/allow-setting-ids.md b/changelog/unreleased/allow-setting-ids.md new file mode 100644 index 00000000000..3ce4fe901b6 --- /dev/null +++ b/changelog/unreleased/allow-setting-ids.md @@ -0,0 +1,5 @@ +Enhancement: Allow setting driveid through graph API + +Allow setting the id through the graph API. This should always be a uuid to avoid clashes, but this is the responsibility of the API user. + +https://github.com/owncloud/ocis/pull/11256 diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index 47b8908b6d7..c3d756686e3 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -384,6 +384,10 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) { Quota: getQuota(drive.Quota, g.config.Spaces.DefaultQuota), } + if drive.Id != nil { + csr.Opaque = utils.AppendPlainToOpaque(csr.Opaque, "spaceid", *drive.Id) + } + if drive.Description != nil { csr.Opaque = utils.AppendPlainToOpaque(csr.Opaque, "description", *drive.Description) }