久久久久久久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 服務器時的歡迎消息)
主站蜘蛛池模板: 国产精品久久久久久久久久三级 | 国产精品视频在线播放 | 老牛影视av一区二区在线观看 | 91网站在线播放 | 国产乱码精品1区2区3区 | 亚洲福利电影网 | 伊人电影院av | 亚洲高清在线视频 | 欧美一区二区三区四区视频 | 日韩精品视频在线 | 欧美中文字幕在线观看 | 国产精品久久久久久久久 | 亚洲国产成人精品女人久久久 | 国产探花在线精品一区二区 | 午夜精品一区二区三区在线视频 | 中国一级毛片免费 | 久久区二区| 精品一区二区三区免费毛片 | 欧美日韩国产免费 | 亚州精品成人 | 日本午夜在线视频 | 亚洲一区久久 | 久久99久久98精品免观看软件 | 国产一区二区精品在线观看 | 91国在线 | 99综合| 亚洲一区 中文字幕 | 男插女下体视频 | 瑟瑟视频在线看 | 日韩一区二区三区在线观看 | 一区二区三区视频在线观看 | 超碰人人人 | av天天看 | 国产欧美精品 | 日本精品视频一区二区三区四区 | 亚洲精品国产成人 | 国产在线视频一区二区董小宛性色 | 精品一区在线 | 亚洲在线一区二区 | 日本一二三区电影 | 国产亚洲精品久久午夜玫瑰园 |