Design problem: Editing and triggering onEdit without editing permissions

62 Views Asked by At

I would like to know how one should approach the problem of creating a sheet with the following requirements:

Let's say User A has access to Sheet1 and Sheet2 but not to Sheet3 (a helper sheet) which is protected and only accessible by admins. Sheet1 has two buttons linked to script functions that need to make edits to Sheet3.

  1. How should I structure my script such that User A can use the buttons in Sheet1?

  2. There is an onEdit(e) function that triggers when edits are made to Sheet1. The onEdit function also makes edits to Sheet3. How should I structure my script such that User A can trigger edits to Sheet3 when they are using Sheet1?

So far, I believe I have only found a solution to problem #1 which is to deploy the script as a web app. What would be the best way to approach problem #2?

If you have a better solution for #1 as well then please feel free to present such alternatives!

Appreciate any help I can get, thanks.

1

There are 1 best solutions below

2
oshliaer On

The best way for this is:

  1. Create the third user
  2. Add full access for the third user
  3. Rename onEdit to onedit
  4. Install onedit as a function of the EDIT trigger