1

Hi google spreadsheet scripters,

script publisher has spreadsheet in publisher's drive. The script does openByURL.

Problem: Google makes user grant authorization for script to update all spreadsheets in user's drive.

That's not where the script is! Why would user want to give publisher access to all spreadsheets in user's drive?

My requirements are: user and script publisher are strangers. Script user refuses to expose user's Drive to script publisher.

Publisher wants to keep proprietary logic unexposed, in hidden script functions (scriptnames_)

// Script-as-app template.
function doGet() {
  var app = UiApp.createApplication();

  url = "https://docs.google.com/spreadsheet/ccc?key=xxx_X'd_out_xxxxxxxxxxx&usp=sharing";
  var doc = SpreadsheetApp.openByUrl(url);
  var spreadsheet_link = app.createAnchor('<br><br> spreadsheet open ', doc.getUrl()).setId("<br>    <br>spreadsheet link");
  app.add(spreadsheet_link);  

  return app;
}

(Yes, I know I could have publisher email a spreadsheet to the user, but I'd still be stuck with the user needing to grant authorizations to publisher's script, which would still cause Google to request authorization for script to modify all spreadsheets on user's drive.)

Apologies if this is rehash of old discussion. I searched and don't see it worded like this. Thanks!

Mike D
  • 33
  • 1
  • 4
  • 1
    small misundertanding here... granting access to spreadsheets in drive does not mean giving access to all spreadsheets, only the ones that user shares with script publisher (or publicly or "to anyone with the link"). – Serge insas Feb 13 '14 at 20:47
  • Oh thanks Serge. That Google permissions request looked pretty comprehensive. I wonder how many users it will scare off from trying the hosted spreadsheet. – Mike D Feb 13 '14 at 22:16
  • This app would like to: View and manage your spreadsheets in Google Drive More info Create new spreadsheets View and modify existing spreadsheets Share spreadsheets with others – Mike D Feb 13 '14 at 23:51

1 Answers1

2

As Serge said

ANSWER

granting access to spreadsheets in drive does not mean giving access to all spreadsheets, only the ones that user shares with script publisher (or publicly or "to anyone with the link")

I tested by trying to access a private spreadsheet in user's GoogleDrive and the script did indeed get an error on execution:

Couldn't open document with id 0Ak2222Ho-SXL222222222222222222: 
You do not have permissions to access the requested document.

I don't know how to mark the question as answered from what Serge said in his comment, so I'll put the answer here so hopefully the question gets marked as answered. Thanks

Mike D
  • 33
  • 1
  • 4