简体   繁体   中英

Access - Scripts Bound to Google Sheets

From the documentation of the the bound script: https://developers.google.com/apps-script/guides/bound

"Only users who have permission to edit a spreadsheet, document, or form can run its bound script. Collaborators who have only view access cannot open the script editor, although if they make a copy of the parent file, they become the owner of the copy and will be able to see and run a copy of the script."

This feature is kinda limited. I have created a big sheet that are used by multiple users. I need the script to be executable by Read Only access users. The script that I created are not making changes to the document, so it should not affect by the access level of the users.

  • Administrator have Edit access to the document. They have access to all calculation/ configuration cells/ sheet.
  • Managers have Edit access to the document. Managers have Edit access to most of the cells/ sheet. Managers task is to update the cells
  • All remaining users only have Read Only access to the document. They can view cells and the automated calculation.

Because the cells have too many columns, I have created a button (eventually I want to move it to onOpen) for easy navigation to a specific cell. This is done dynamically based on today's date. This is working fine as expected for Administrator and Manager (have Edit access), however not available for the rest of the users with Read Only access.

Is there any workaround for this?

Thanks

Unfortunately not. You are the edge case. The whole point of GAS is to make editing easier, providing tools. A Google document/Spreadsheet/etc. normally isn't THAT hard to maneuver through.

However, if your REALLY want viewers to see specific parts of your spreadsheet, but not edit it, you could try making a standalone script. Have it pull data from the spreadsheet using the spreadsheet's id and then project it on the HTML page, in a table or list.

I Agree with EvSunWood, though I would go about the task in a slightly different way. You could give read only access to the main sheet to the user. And then give them full access to a separate sheet with code attached which onOpen updates itself from the original with all of the latest data and then navigates to the appropriate row.

我也同意这个答案 ,不可能只允许用户查看脚本来执行脚本,但是与使用脚本覆盖已编辑的数据相反,我建议您使用工作表/范围保护,这样我们可以减少脚本失败的风险,例如由于多个用户几乎同时打开同一文件而导致的“更改冲突”,因此在打开触发器时会出现这种情况。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM