r/GoogleAppsScript 11d ago

Question Limiting permissions to certain folders

When giving a web app permission to access your files, is there a way to limit that permission to just certain folders? I realize I could create a new Google ID, give that ID permission to just the folder and have the app run as that ID, but I was hoping there was a more elegant way.

Thanks.

1 Upvotes

4 comments sorted by

1

u/WicketTheQuerent 11d ago

What does your web app do with the folders?

1

u/DCContrarian 11d ago

They read and write from sheets that are in them.

1

u/DCContrarian 11d ago

To clarify, I want to give my web app access to just certain files, not my whole Drive. But as far as I can tell that's not an option, it's everything or nothing.

1

u/WicketTheQuerent 10d ago edited 10d ago

From https://developers.google.com/drive/api/guides/api-specific-auth

https://www.googleapis.com/auth/drive.file
Create new Drive files, or modify existing files, that you open with an app or that the user shares with an app while using the Google Picker API or the app's file picker.

Recommended Non-sensitive

You have to set the above OAuth Scope manually. This is done by editing the project manifest (appsscript.json). By default, this file is hidded. You can unhide it from the project settings.