mirror of
https://github.com/rclone/rclone.git
synced 2025-01-13 20:38:12 +02:00
drive: fix server side copy with metadata from my drive to shared drive
Before this change trying to server side copy an object from a my drive to a shared drive using --metadata caused this error: Sharing restrictions cannot be set on a shared drive item., teamDrivesSharingRestrictionNotAllowed This was because we were setting the "writers-can-share" metadata which isn't allowed on shared drives
This commit is contained in:
parent
d11fe9779e
commit
efed6b01d2
@ -37,7 +37,7 @@ var systemMetadataInfo = map[string]fs.MetadataHelp{
|
|||||||
Example: "true",
|
Example: "true",
|
||||||
},
|
},
|
||||||
"writers-can-share": {
|
"writers-can-share": {
|
||||||
Help: "Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.",
|
Help: "Whether users with only writer permission can modify the file's permissions. Not populated and ignored when setting for items in shared drives.",
|
||||||
Type: "boolean",
|
Type: "boolean",
|
||||||
Example: "false",
|
Example: "false",
|
||||||
},
|
},
|
||||||
@ -528,8 +528,12 @@ func (f *Fs) updateMetadata(ctx context.Context, updateInfo *drive.File, meta fs
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
case "writers-can-share":
|
case "writers-can-share":
|
||||||
if err := parseBool(&updateInfo.WritersCanShare); err != nil {
|
if !f.isTeamDrive {
|
||||||
return nil, err
|
if err := parseBool(&updateInfo.WritersCanShare); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fs.Debugf(f, "Ignoring %s=%s as can't set on shared drives", k, v)
|
||||||
}
|
}
|
||||||
case "viewed-by-me":
|
case "viewed-by-me":
|
||||||
// Can't write this
|
// Can't write this
|
||||||
|
Loading…
Reference in New Issue
Block a user