1

我正在尝试针对 DocsList 运行一个脚本,该脚本将收集查看者和编辑者的列表,然后对他们执行一些“工作”。(具体来说,我试图从相关文件中剥夺权利)。它工作得很好对于用户。但是对于组,它返回组名而不是电子邮件。我找不到使用应用程序脚本从该信息中检索组电子邮件地址的任何方法。如果我运行 fileObject.removeEditor( Group Name ) 告诉我这是一封无效的电子邮件(完全正确)。

我愿意接受建议......我完全被困在这里。

或者,我愿意采用一种我没想过的方式来删除对 Google Docs 中一堆文件的所有共享权限。

function getDocs(){
  var myFolders = DocsList.getAllFolders();
  var myFiles = DocsList.getAllFiles(0,10);
  var mySharing = new Array();

  for(x in myFiles){
    mySharing[x] = [myFiles[x].getId(), myFiles[x].getEditors(), myFiles[x].getViewers()];  
     for(y in mySharing[x][1]){
       if(mySharing[x][1][y].toString() != "doc.owner@deltahotels.com"){
         myFiles[x].removeEditor(mySharing[x][1][y]);
       }
     }
     for(y in mySharing[x][2]){
       if(mySharing[x][2][y].toString() != "doc.owner@deltahotels.com"){
         myFiles[x].removeEditor(mySharing[x][1][y]);
       }
     }
  }

}
4

1 回答 1

2

感谢您提出这个问题。这是 getEditors/getViewers 方法处理组的方式的问题。我已经在问题跟踪器中为您提出了这个问题。请给它加星标以更新进度。

于 2012-05-29T20:46:04.857 回答