将单元格的第一个编辑者设置为Google电子表格的所有者?

时间:2019-03-01 20:49:23

标签: google-apps-script google-sheets spreadsheet

比方说,我与很多人共享一个Google电子表格文档,如果有人编辑一个单元格,他将成为该单元格的所有者,而其他人则无法对其进行编辑。我找到了一种解决方案,该解决方案可能允许登录的用户进行这种行为:

  function onEdit(e) { 
  var active =  SpreadsheetApp.getActive().getActiveCell();
  const protection = active.protect();
  protection.removeEditors(protection.getEditors());
  protection.setDomainEdit(false);
};

我如何为匿名用户(未邀请到电子表格中)获得相同的效果?

0 个答案:

没有答案
相关问题