I have a Google Apps Script that generates a new copy from a template spreadsheet.
However, the default setting of the new copy allows our domain to view it. I want to set its default permission via app script to RESTRICTED, equivalent to the UI shown below, so that I can only add specific editors or viewers.
I explored setDomainEdit()
but the available examples online seem to apply to protected ranges and sheets. I'm not sure if that will address my requirement, but let me know.
Would someone kindly point me in the right direction?
DriveApp
and it's corresponding setSharing method for that. When you give permissions to a spreadsheet, it is treated like any otherFile
- hence no sheet-specific API method. Also, please, do not add "thanks" part in the question, please - it somewhat frowned upon – Oleg Valter