mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08: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",
|
||||
},
|
||||
"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",
|
||||
Example: "false",
|
||||
},
|
||||
|
@ -528,9 +528,13 @@ func (f *Fs) updateMetadata(ctx context.Context, updateInfo *drive.File, meta fs
|
|||
return nil, err
|
||||
}
|
||||
case "writers-can-share":
|
||||
if !f.isTeamDrive {
|
||||
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":
|
||||
// Can't write this
|
||||
case "content-type":
|
||||
|
|
Loading…
Reference in New Issue
Block a user