-1

I have 3 types of users:

  • Manager (1)
  • Captain (1)
  • Players (n)

I have 2 types of sheets:

  • Master (1)
  • Details (n)

The manager is the owner of all sheets. The players can only see and read their respective Details.

My question relates to the Captain who is supposed to:

  • edit the Master and
  • execute a script within the Master which moves the data from the Master to the Details

In the script I am planning to put a check like:

if (thisUser == 'Manager@gmail.com' ...

BUT how do I authorise the Captain to execute the script and post data in a sheet in the Details-sheets for which the Captain is not editor nor reader?

mortpiedra
  • 81
  • 8

1 Answers1

0
  • Publish a webapp from a standalone script by Manager:

  • Execute as: me

  • Access: anyone

  • Include a doPost function, which will execute moving data from "Master" to "Details"

  • Share the script with "Captain"

  • In "Manager" sheet, Add a script function(say, postToWebApp) to post( using UrlFetchApp + ScriptApp.getAccessToken()) to the standalone webapp.

  • Now, "Captain" can execute postToWebApp and post relevant data to the webapp to start moving data from "Master" to "Details" under authority of "Manager".

  • You need to use additional authentication/ authorization security measures like HMAC to make sure no one else can do the same(as the webapp is published with Access: Anyone).

  • Related Answer: Is there a way to let a user edit another spreadsheet with a script and hide it from him at the same time?

TheMaster
  • 45,448
  • 6
  • 62
  • 85