Google 驱动器:哪种范围组合可以让应用读取现有文件但没有 edit/delete 权限?
Google Drive: What combination of scopes lets an app read existing files but not have edit/delete privileges?
我发现在 https://www.googleapis.com/auth/drive
范围内,我的应用程序可以读取 Google 驱动器中的所有现有文件(及其内容),但是当我授权该应用程序时,它说这scope 还可以删除 驱动器中的文件,我不想授予它。
我知道它本身 https://www.googleapis.com/auth/drive.file
只允许应用程序读取由应用程序本身 创建 或特别授予访问权限的文件。
我尝试过其他组合,但找不到应用程序可以读取我能看到的任何文件的内容,但不能删除任何内容的组合。这是我最近的一次:
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.activity
https://www.googleapis.com/auth/documents
有没有可以实现我的目标的组合?
如果您有权读取和写入文件,那么您还可以删除该文件。
这是他们设置权限的方式。
如果您不想上传而只想下载,请尝试只读驱动器。
如果您不打算创建任何文件或将任何数据保存到云端硬盘,那么您有 https://www.googleapis.com/auth/drive.readonly
范围。
请注意,这是一个受限范围,它将授予您的应用对用户的整个云端硬盘的只读访问权限,但它也会阻止您的应用创建任何新文件或编辑现有的。
如果您希望您的应用程序能够访问整个云端硬盘,并且您打算将您的应用程序发布到 public,您应该将您的应用程序提交到 restricted scope verification and security assessment; otherwise your app will be limited to 100 users, and users will see a warning while your app is unverified。
这里有更多信息:
根据您的需求,您应该关注https://www.googleapis.com/auth/drive.readonly
。这使您能够读取文件元数据和内容。
Allows read-only access to file metadata and file content.
资源:
我发现在 https://www.googleapis.com/auth/drive
范围内,我的应用程序可以读取 Google 驱动器中的所有现有文件(及其内容),但是当我授权该应用程序时,它说这scope 还可以删除 驱动器中的文件,我不想授予它。
我知道它本身 https://www.googleapis.com/auth/drive.file
只允许应用程序读取由应用程序本身 创建 或特别授予访问权限的文件。
我尝试过其他组合,但找不到应用程序可以读取我能看到的任何文件的内容,但不能删除任何内容的组合。这是我最近的一次:
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.activity
https://www.googleapis.com/auth/documents
有没有可以实现我的目标的组合?
如果您有权读取和写入文件,那么您还可以删除该文件。
这是他们设置权限的方式。
如果您不想上传而只想下载,请尝试只读驱动器。
如果您不打算创建任何文件或将任何数据保存到云端硬盘,那么您有 https://www.googleapis.com/auth/drive.readonly
范围。
请注意,这是一个受限范围,它将授予您的应用对用户的整个云端硬盘的只读访问权限,但它也会阻止您的应用创建任何新文件或编辑现有的。
如果您希望您的应用程序能够访问整个云端硬盘,并且您打算将您的应用程序发布到 public,您应该将您的应用程序提交到 restricted scope verification and security assessment; otherwise your app will be limited to 100 users, and users will see a warning while your app is unverified。
这里有更多信息:
根据您的需求,您应该关注https://www.googleapis.com/auth/drive.readonly
。这使您能够读取文件元数据和内容。
Allows read-only access to file metadata and file content.