當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


R googledrive drive_scopes 特定於 Drive API 的生成範圍


當不帶參數調用時,drive_scopes() 返回與 Drive API 關聯的範圍的命名字符向量。如果給出drive_scopes(scopes =),則縮寫條目(例如"drive.readonly")將擴展到完整範圍(在本例中為"https://www.googleapis.com/auth/drive.readonly")。無法識別的範圍將保持不變地通過。

用法

drive_scopes(scopes = NULL)

參數

scopes

一個或多個 API 範圍。每個範圍都可以完整指定,或者對於驅動器 API-specific 範圍,以 drive_scopes() 識別的縮寫形式指定:

  • "drive" =“https://www.googleapis.com/auth/drive”(默認值)

  • "full" = "https://www.googleapis.com/auth/drive"(與"drive"相同)

  • "drive.readonly" = "https://www.googleapis.com/auth/drive.readonly"

  • "drive.file" = "https://www.googleapis.com/auth/drive.file"

  • "drive.appdata" = "https://www.googleapis.com/auth/drive.appdata"

  • "drive.metadata" =“https://www.googleapis.com/auth/drive.metadata”

  • "drive.metadata.readonly" = "https://www.googleapis.com/auth/drive.metadata.readonly"

  • "drive.photos.readonly" = "https://www.googleapis.com/auth/drive.photos.readonly"

  • "drive.scripts" = "https://www.googleapis.com/auth/drive.scripts

參看https://developers.google.com/drive/api/guides/api-specific-auth有關每個範圍的權限的詳細信息。

範圍的字符向量。

也可以看看

https://developers.google.com/drive/api/guides/api-specific-auth有關每個範圍的權限的詳細信息。

其他驗證函數:drive_auth_configure()drive_auth()drive_deauth()

例子

drive_scopes("full")
#> [1] "https://www.googleapis.com/auth/drive"
drive_scopes("drive.readonly")
#> [1] "https://www.googleapis.com/auth/drive.readonly"
drive_scopes()
#>                                                     drive 
#>                   "https://www.googleapis.com/auth/drive" 
#>                                                      full 
#>                   "https://www.googleapis.com/auth/drive" 
#>                                            drive.readonly 
#>          "https://www.googleapis.com/auth/drive.readonly" 
#>                                                drive.file 
#>              "https://www.googleapis.com/auth/drive.file" 
#>                                             drive.appdata 
#>           "https://www.googleapis.com/auth/drive.appdata" 
#>                                            drive.metadata 
#>          "https://www.googleapis.com/auth/drive.metadata" 
#>                                   drive.metadata.readonly 
#> "https://www.googleapis.com/auth/drive.metadata.readonly" 
#>                                     drive.photos.readonly 
#>   "https://www.googleapis.com/auth/drive.photos.readonly" 
#>                                             drive.scripts 
#>           "https://www.googleapis.com/auth/drive.scripts" 
源代碼:R/drive_auth.R

相關用法


注:本文由純淨天空篩選整理自Jennifer Bryan等大神的英文原創作品 Produce scopes specific to the Drive API。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。