久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

“共享驅動器"Google Apps 腳本中的支持

quot;Shared Drivequot; support in Google Apps Script(“共享驅動器Google Apps 腳本中的支持)
本文介紹了“共享驅動器"Google Apps 腳本中的支持的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在 Google Apps 腳本中編寫一個 JavaScript 工具來檢查文檔的某些屬性,例如所有鏈接都有效"、權限設置是否正確"等等.我正在使用 https://developers.google.com 中記錄的 API/apps-script/reference/drive/drive-app 按 ID 查找文件、檢查其權限、在 Google Drive 等中定位它們,但我發(fā)現(xiàn)共享驅動器"不能很好地與那個 API.

I am writing a JavaScript tool in Google Apps Script to check some properties of documents, like "are all links valid", "are permissions set correctly", and so on. I am using the API documented in https://developers.google.com/apps-script/reference/drive/drive-app to look up files by ID, check their permissions, locate them in Google Drive etc., but I found that "Shared Drives" don't work very nicely with that API.

例如,

  • 對于共享云端硬盤的根文件夾,Folder.getName() 只返回Drive"而不是 Drive 的名稱,
  • 即使 mygroup@domain.com 是共享驅動器的管理員",folder.getAccess('mygroup@domain.com') 也是 NONE 并且 folder.getViewers() 為空,
  • 共享云端硬盤中的某些文件夾不(始終)包含在 DriveApp.getFolders() 迭代器.
  • for the root folder of a Shared Drive, Folder.getName() only returns "Drive" rather than the Drive's name,
  • even though mygroup@domain.com is a "Manager" of the Shared Drive, folder.getAccess('mygroup@domain.com') is NONE and folder.getViewers() is empty,
  • some folders in Shared Drives are not (always) included in the DriveApp.getFolders() iterator.

尤其是第二點現(xiàn)在對我來說是一個障礙,但是我在這里缺少什么?我應該使用其他一些 API,還是我應該報告它只是一個錯誤?是否有一些文檔說明我可以和不可以與共享驅動器一起使用的 Drive API 的哪些功能?

In particular the second point is a blocker for me now, but what am I missing here? Is there some other API I should be using, or is it simply a bug that I should report? Is there some documentation of what functionality of the Drive API I can and cannot use with Shared Drives?

推薦答案

使用 AdvancedDrive Service 而不是 DriveApp

  • 確實,共享驅動器不受范圍有限的 DriveApp 支持
  • 但如果您啟用 Advanced Drive Service,你將能夠在 Apps Script 中使用 的所有方法支持共享驅動器的 Drive API v2
  • Use the Advanced Drive Service instead of DriveApp

    • Indeed, shared drives are not supported by DriveApp which has a limited scope
    • But if you enable the Advanced Drive Service, yuo will be able to use in Apps Script all methods of the Drive API v2 which support shared drives
    • 示例:

      function myFunction() {
        var sharedDriveName = Drive.Drives.get("XXXXXXXXXXXXXXXXXXX").name;
        //it is important to specify that the folder is located on a shared drive with {"supportsAllDrives": true}
        var folderOnDriveName = Drive.Files.get("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",{"supportsAllDrives": true}).title;
        var folderPermissions = Drive.Permissions.list("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",{"supportsAllDrives": true});
      }
      

      這篇關于“共享驅動器"Google Apps 腳本中的支持的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

      【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

相關文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機器人提及發(fā)出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復必須使用導入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務器時的歡迎消息)
主站蜘蛛池模板: 日韩成人一区 | 成人影音 | 91久操视频 | 亚洲av毛片| 欧美精品乱码久久久久久按摩 | 国产成人一区二区三区久久久 | 男女羞羞视频网站 | 成人高清在线视频 | 九九热精品在线视频 | 欧美美女被c | 精品日韩一区 | 亚洲欧美中文字幕 | 精品久久香蕉国产线看观看亚洲 | 欧美一区2区三区3区公司 | 国产一级在线 | 久久不射电影网 | 中文字幕丁香5月 | 国产91丝袜在线熟 | 毛片a| 亚洲社区在线 | 亚洲精品久久久久久宅男 | 欧美视频一区二区三区 | 亚洲成人一区二区 | 日韩中文字幕在线观看视频 | 嫩草黄色影院 | 在线免费观看成年人视频 | 91精品国产综合久久久久久丝袜 | 国产一区二区三区免费观看视频 | 亚洲一区二区久久久 | 亚洲精品天堂 | 91精品国产乱码久久蜜臀 | 亚洲精品综合 | 福利视频日韩 | 另类 综合 日韩 欧美 亚洲 | 天天亚洲| 一区二区三区在线播放视频 | 国产一伦一伦一伦 | 久久精品小视频 | 国产精品久久久久久久久久久久久久 | 国产一区二区三区色淫影院 | 日韩精品一区二区三区四区视频 |