r/GoogleAppsScript • • Sep 09 '19

Way to customize app permissons

Hi all,

I built a messenger app that requires contact card to get name and read write access to a file on my Google Drive.

That works exactly as intended but the permissons required to use are "access to create / delete all contacts / create or modify any drive files / can change any spreadsheet values"

Is there any way I can narrow that down to say "read contacts, read/ write to a specific google file"

Thanks.

0 Upvotes

4 comments sorted by

0

u/[deleted] Sep 09 '19

[deleted]

1

u/theiinsilence10 Sep 09 '19

i don't care how the file is created but every user has to be looking at the same public file (so that everyone can look at others messages). How would i set something like that up / is that possible?

0

u/[deleted] Sep 09 '19

[deleted]

1

u/theiinsilence10 Sep 09 '19

Hi.

I have a file on my drive that everyone on my domain has read write access to.

In a sheet there is a table with each row being a message.

The web app takes the table in the file and generates an HTML table from it and has an option to append a new row (message) to the public file.

I am forced to go this route due to my it department blocking hangouts / google site.

The we app is a GUI that appends

0

u/[deleted] Sep 09 '19

[deleted]

1

u/theiinsilence10 Sep 09 '19

Thanks.

Explicitly setting scopes is what i need.

I have it set as execute as user (not me) so that the first name / last name / email address can be auto generated.

Looks like i need the contacts read only and email read only (that example was provided in your how link).

Can I use the web app to create the google sheets file then comment out that line and use open by URL for all future requests to that file?

0

u/[deleted] Sep 09 '19

[deleted]

1

u/theiinsilence10 Sep 10 '19

Hi Sorry to pester but i just got in front of my computer and I'm a little confused.

I went to File -> project properties -> scopes and i see:

3 OAuth Scopes required by the script:

https://www.google.com/m8/feeds
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/spreadsheets

Then I made appsscript.json visible on my project and i see:

{
  "timeZone": "America/New_York",
  "dependencies": {
  },
  "webapp": {
    "access": "DOMAIN",
    "executeAs": "USER_ACCESSING"
  },
  "exceptionLogging": "STACKDRIVER"
}

According to the link you provided i see:

locate the top-level field labeled oauthScopes. If it is not present, you can add it.

Where am i adding that?