Google apps script grant user permissions access s

2019-07-31 13:22发布

Well... I have a problem, no I must say that is a request from the client.

Like everyone know that if the script access any service, then you must grant them the permission on the first time run the function. I mean click to the "grant" button.

The thing is the project I do user run script via custom menu on SpreadSheet, they will not open script editor. The first time run script will need to click to diablog to grant permissions. So if it is the first time user (not me) run the script via SpreadSheet menu then SpreadSheet will show the message "Running script..." any nothing more.

So if there are any way to grant user permissions access services with out to open script editor (I don't want them view my source for my good and them to ) then tell my your guys. Many Thank!

P/S: And sorry for my poor English.

1条回答
够拽才男人
2楼-- · 2019-07-31 13:49

If you use only default apis (no o-auth) the first time a new user will try to run any of the function he will be prompted to grant access to these services. If you want to make it more obvious you can add a menu item called 'Authorize' in your custom menu that would do what it says :-) I.e nothing except trigger the process or eventually show a welcome message... After that step there will be no more authorization request.

查看更多
登录 后发表回答