更改CalendarApp.getallcalendards()方法的范围

问题描述 投票:0回答:1

在我的代码库中,我使用CalendarApp.getallcalendar()拥有所有用户的日历。

此方法已获得此授权:

https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/calendar.readonly
https://www.google.com/calendar/feeds

根据我的脚本的专有知识,日历的范围为https://www.googleapis.com/auth/calendar因此,当用户访问我的脚本应用程序时,权限为:“ ...编辑和删除日历...”,但是我只需要阅读它。应该可以改变吗?我想要这个范围:https://www.googleapis.com/auth/calendar.readonly

google-apps-script publishing
1个回答
0
投票

只需从作用域数组中删除https://www.googleapis.com/auth/calendar,因为它为您提供了读/写访问权限。在清单中进行更改,然后尝试再次运行该应用程序,然后将要求您再次授权(使用新作用域)。

© www.soinside.com 2019 - 2024. All rights reserved.