mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
drive: add --metadata-force-expansive-access flag - Fixes #8980
This allows the permissions changes happening in Feb 2026 to be tested in advance.
This commit is contained in:
@@ -733,6 +733,17 @@ two accounts.
|
|||||||
Advanced: true,
|
Advanced: true,
|
||||||
Default: rwOff,
|
Default: rwOff,
|
||||||
Examples: rwExamples,
|
Examples: rwExamples,
|
||||||
|
}, {
|
||||||
|
Name: "metadata_enforce_expansive_access",
|
||||||
|
Help: `Whether the request should enforce expansive access rules.
|
||||||
|
|
||||||
|
From Feb 2026 this flag will be set by default so this flag can be used for
|
||||||
|
testing before then.
|
||||||
|
|
||||||
|
See: https://developers.google.com/workspace/drive/api/guides/limited-expansive-access
|
||||||
|
`,
|
||||||
|
Advanced: true,
|
||||||
|
Default: false,
|
||||||
}, {
|
}, {
|
||||||
Name: config.ConfigEncoding,
|
Name: config.ConfigEncoding,
|
||||||
Help: config.ConfigEncodingHelp,
|
Help: config.ConfigEncodingHelp,
|
||||||
@@ -812,6 +823,7 @@ type Options struct {
|
|||||||
MetadataOwner rwChoice `config:"metadata_owner"`
|
MetadataOwner rwChoice `config:"metadata_owner"`
|
||||||
MetadataPermissions rwChoice `config:"metadata_permissions"`
|
MetadataPermissions rwChoice `config:"metadata_permissions"`
|
||||||
MetadataLabels rwChoice `config:"metadata_labels"`
|
MetadataLabels rwChoice `config:"metadata_labels"`
|
||||||
|
EnforceExpansiveAccess bool `config:"metadata_enforce_expansive_access"`
|
||||||
Enc encoder.MultiEncoder `config:"encoding"`
|
Enc encoder.MultiEncoder `config:"encoding"`
|
||||||
EnvAuth bool `config:"env_auth"`
|
EnvAuth bool `config:"env_auth"`
|
||||||
}
|
}
|
||||||
@@ -3092,6 +3104,7 @@ func (f *Fs) PublicLink(ctx context.Context, remote string, expire fs.Duration,
|
|||||||
_, err = f.svc.Permissions.Create(id, permission).
|
_, err = f.svc.Permissions.Create(id, permission).
|
||||||
Fields("").
|
Fields("").
|
||||||
SupportsAllDrives(true).
|
SupportsAllDrives(true).
|
||||||
|
EnforceExpansiveAccess(f.opt.EnforceExpansiveAccess).
|
||||||
Context(ctx).Do()
|
Context(ctx).Do()
|
||||||
return f.shouldRetry(ctx, err)
|
return f.shouldRetry(ctx, err)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ func (f *Fs) setPermissions(ctx context.Context, info *drive.File, permissions [
|
|||||||
_, err := f.svc.Permissions.Create(info.Id, perm).
|
_, err := f.svc.Permissions.Create(info.Id, perm).
|
||||||
SupportsAllDrives(true).
|
SupportsAllDrives(true).
|
||||||
SendNotificationEmail(false).
|
SendNotificationEmail(false).
|
||||||
|
EnforceExpansiveAccess(f.opt.EnforceExpansiveAccess).
|
||||||
Context(ctx).Do()
|
Context(ctx).Do()
|
||||||
return f.shouldRetry(ctx, err)
|
return f.shouldRetry(ctx, err)
|
||||||
})
|
})
|
||||||
@@ -483,6 +484,7 @@ func (f *Fs) setOwner(ctx context.Context, info *drive.File, owner string) (err
|
|||||||
SupportsAllDrives(true).
|
SupportsAllDrives(true).
|
||||||
TransferOwnership(true).
|
TransferOwnership(true).
|
||||||
// SendNotificationEmail(false). - required apparently!
|
// SendNotificationEmail(false). - required apparently!
|
||||||
|
EnforceExpansiveAccess(f.opt.EnforceExpansiveAccess).
|
||||||
Context(ctx).Do()
|
Context(ctx).Do()
|
||||||
return f.shouldRetry(ctx, err)
|
return f.shouldRetry(ctx, err)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user