- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们需要一份完整的列表,其中包含已获得 Google 云端硬盘上特定演示文稿/文档的“共享”查看权限的人员。我们有屏幕截图,但可能还不够。我们如何以编程方式检索此信息?
最佳答案
附加到 File
对象的属性包括三个与用户相关的项目:
User
对象,使用 File.getOwner()
检索。Users
数组,使用 File.getEditors()
检索。包括所有者。Users
数组,使用 File.getViewers()
检索。包括所有者。这些只能由文件所有者以编程方式获得。
以下函数是来自 Restore trashed google drive files to a target folder 的实用程序. getFileInfo()
函数返回一个对象,该对象具有提供的 File
或 Folder
的属性,包括编辑器和查看器。它会忽略编辑者和查看者列表中的所有者。请随意根据您自己的情况进行调整。注意:它依赖于您会发现的其他实用函数 in this gist .
/**
* Return an object containing relevant information about the given file.
* See https://developers.google.com/apps-script/class_file.
* From: https://gist.github.com/mogsdad/4644369
*
* @param {Object} file File or Folder object to examine.
*
* @return {Object} Interesting file attributes.
* <pre>{
* id: unique id (ID) of the folder or file
* name: the name of the File
* size: the size of the File
* type: The type of the file
* created: date that the File was created
* description: the description of the File
* owner: user id of the owner of the File
* otherViewers: list of user ids of viewers of the File, w/o owner
* otherEditors: list of user ids of editors of the File, w/o owner
* }</pre>
*/
function getFileInfo (file) {
var fileInfo = {
id: file.getId(),
name: file.getName(),
size: file.getSize(),
type: (file.getMimeType) ? docTypeToText_(file.getMimeType()) : "folder", // DriveApp Folders don't have getMimeType() method.
created: file.getDateCreated(),
description: file.getDescription(),
owner: userNames([file.getOwner()],false),
otherViewers: userNames(file.getViewers(),true),
otherEditors: userNames(file.getEditors(),true)
};
return fileInfo;
}
这是文件属性的示例:
{ "id": "0B2kSPNhhUowaRGZKY3VGLUZCREk",
"name": "Rescued Files",
"size": 0,
"type": "folder",
"created": "2016-06-13T20:18:14.526Z",
"description": "",
"owner": "user@example.com",
"otherViewers": "none",
"otherEditors": "none"
}
下面是一个脚本,可以扫描您 Google Drive 中的所有文件和文件夹,生成包含用户信息的日志。 (它没有避免超时的规定,买者自负!)
/**
* Generate logs with user sharing info for all files & folders.
*/
function showSharing() {
var files = DriveApp.getFiles();
var folders = DriveApp.getFolders();
while (files.hasNext() || folders.hasNext()) {
var iterator = files.hasNext() ? files : folders;
Logger.log(JSON.stringify(getFileInfo(iterator.next())));
}
}
关于google-apps-script - 列出 Google 云端硬盘上特定演示文稿/文档的所有共享用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14397910/
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
在这个abc.php文件中写入如下代码。 ? 1
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我喜欢用 dotvvm 建立一个视频演示网站。当什么都没有发生时,每次从列表中播放新视频时它都必须开始。使用 bootstrap/MediaObject 我找不到“视频准备播放”事件,因此我们可以开始
我正在开发一个拼贴应用程序,为此我使用DKImagePickerController一次选择多个图像。 pod 的 Github 链接是 https://github.com/zhangao0086/
我试图证明 move 构造函数在消除不必要的复制方面的有用性。但是,当我在 Release 中运行时,Visual Studio 优化器会忽略拷贝。当 move 构造函数不可用时不会调用复制构造函数,
我正在尝试用我自己的测试项目重新创建 HornetQ 示例。但是我遇到了类加载器问题。显然,我缺少文档中未指定的一些依赖项。 文档让我添加 hornetq-core-client.jar netty.
这如何在 Markdown 中完成? 我在 Rmarkdown 中使用投影仪演示文稿,我想要幻灯片左侧的图像和幻灯片右侧的文本。 基本上,这是做什么的:https://tex.stackexchang
有时您需要创建一个 非常 Qt4 中的简单单文件应用程序。然而这是有问题的,因为你总是在做 CPP/H 分离,然后 main() 在另一个文件中...... 任何想法如何在单个文件中执行此操作?尽快弄
有很多关于 SAPUI5 拆分应用程序的演示、教程和文档,但我找不到大量非拆分应用程序的演示。哪里可以买到吗? 为什么如此关注拆分应用程序?它们非常适合移动设备,但我认为桌面应用程序不需要它们。 主视
我的页面 div#posts 下的部分根据脚本结果进行更新。这是一个老式的 mysql 选择查询,回显所有结果标签。 例如foreach($输出为$view) echo “{$view['smthin
ReportLab 用户指南中说: The colortest.py script in reportlab/demos/colors demonstrates thedifferent ways i
ReportLab 用户指南中说: The colortest.py script in reportlab/demos/colors demonstrates thedifferent ways i
我从 git 下载了 PF 演示:https://github.com/primefaces/showcase 并运行 mvn package,但收到以下消息: martin@MyUbuntu:~/
我看过一些程序显示惊人的高度详细的 3d 场景和配乐,但让我震惊的是它们都小于 64kB!这些程序如何运作? 最佳答案 他们按程序生成内容。即他们不添加 3d 模型、位图、基于样本的音频文件,...而
我想让这个休息服务工作: http://www.vogella.de/articles/REST/article.html 在3.4章节,我想运行服务,但是好像不可用。我从教程中复制粘贴了代码。 To
有人可以向我指出 JFreeChart 的 XYSplineRenderer 的工作示例吗? 最佳答案 虽然我从未见过该示例,但XYSplineRendererDemo1.java 是一个可以在dem
我已经下载并解压了 Havok demos ,但该项目依赖于一个文件夹: $(HAVOK_SDKS_DIR)/win32/dx/Include 但它没有设置 HAVOK_SDKS_DIR(没有安装程序
我已经检查了 10 种方法,为什么使用谷歌地图的简单应用程序不能工作,但我没有任何正确的解决方案。我还尝试运行位于 ...\android-sdks\extras\google\google_play
我已经从 oracle 下载中下载了 Swingset2 和 SwingSet3 演示文件(来自“使用 Swing 创建 GUI”教程)(并将它们解压缩/解压到用于 NetBeans 编译器的工作区)
我是一名优秀的程序员,十分优秀!