fix owner on non personal spaces
This commit is contained in:
@@ -223,7 +223,6 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
csr := storageprovider.CreateStorageSpaceRequest{
|
csr := storageprovider.CreateStorageSpaceRequest{
|
||||||
Owner: us,
|
|
||||||
Type: driveType,
|
Type: driveType,
|
||||||
Name: spaceName,
|
Name: spaceName,
|
||||||
Quota: getQuota(drive.Quota, g.config.Spaces.DefaultQuota),
|
Quota: getQuota(drive.Quota, g.config.Spaces.DefaultQuota),
|
||||||
@@ -237,6 +236,10 @@ func (g Graph) CreateDrive(w http.ResponseWriter, r *http.Request) {
|
|||||||
csr.Opaque = utils.AppendPlainToOpaque(csr.Opaque, "spaceAlias", *drive.DriveAlias)
|
csr.Opaque = utils.AppendPlainToOpaque(csr.Opaque, "spaceAlias", *drive.DriveAlias)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if driveType == "personal" {
|
||||||
|
csr.Owner = us
|
||||||
|
}
|
||||||
|
|
||||||
resp, err := client.CreateStorageSpace(r.Context(), &csr)
|
resp, err := client.CreateStorageSpace(r.Context(), &csr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, err.Error())
|
errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, err.Error())
|
||||||
|
|||||||
Reference in New Issue
Block a user