I'm making a google sheets addon and I copy a template sheet from my google drive to the user's current google spreadsheet using:
let ss = SpreadsheetApp.getActive();
let source = SpreadsheetApp.openById(TemplateSpreadsheetId); // <-- gets scope error
let newSheet = source.getSheetByName(mainSheetName).copyTo(ss);
It works when I specify scope https://www.googleapis.com/auth/spreadsheets" in appsscript.json, but is there a way to use a narrower Google Apps Script Authorization Scope ? Other than this I only need @OnlyCurrentDoc or https://www.googleapis.com/auth/spreadsheets.currentonly"
The reason this matters it that users will have to agree that my addon can "See, edit, create, and delete your spreadsheets in Google Drive", which sounds like kind of scary permissions to me.
.readonly
to the general spreadsheets one, but I suspect you will still have issues. – tehhowchSheet
class is not directly sendable. You alone know how you want to use the template, so you alone know what specific data you need to store in the template. – tehhowch