Change permissions of a google sheet / newly created sheet.
See original GitHub issuePermissions are scope of google drive in googleapis and not sheets but it would be cool to have that integrated with this implementation of spreadsheet.
My usecase : I would like to make a sheet public and get the new url.
This is how I do it right now.
let { google } = require('googleapis');
var creds = require('./google-creds.json');
(async function main() {
const jwtClient = new google.auth.JWT(
creds.client_email,
null,
creds.private_key,
['https://www.googleapis.com/auth/drive'],
null
);
drive = google.drive({ version: "v3", auth: jwtClient });
const res = await drive.permissions.create({
resource: {
type: "anyone",
role: "writer" // Please set the email address you want to give the permission.
},
fileId: doc.spreadsheetId,
fields: "id",
});
})();
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Google Sheets Permissions: Edit, Comment, View | Layer Blog
Change Sheets permissions for an entire spreadsheet · 1. Click on the “Share” button in the top-right corner. · 2. To the right...
Read more >How to Set Editing Permissions in Google Sheets - Technipages
You can do this by going to Data > Protected Sheets and Ranges > Sheet > Set Permissions, and in the following window,...
Read more >Google Sheets permissions: Different levels and use
Google Sheets offers four different permission levels; ownership, edit, comment, and view. There are many different situations in which you would benefit from ......
Read more >Protect, hide, and edit sheets - Google Docs Editors Help
Open a spreadsheet in Google Sheets. · Click Data and then Protected sheets and ranges. · Click Add a sheet or range or...
Read more >Sharing and permissions in Google Sheets - Tiller Help Center
If you do not have edit access to a spreadsheet that is shared with you and you need to add data or edit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not currently. You will have to make the request to the drive API yourself. Either via an http request, or using google’s official npm module.
I just pushed up my wip on the rewrite which has this functionality. Look here
Yes, this must be the solution. Can your library handle this part? If no, what would you suggest? It already created one spreadsheet so I would need to successfully change permissions on that, then I am finished.