Google 日历 API 范围 - calendar.readonly 和 calendar.events.readonly 之间有什么区别?
What's the difference between the Google Calendar API scopes - calendar.readonly and calendar.events.readonly?
根据文档 (here),Google 提供了一些相同的范围:
https://www.googleapis.com/auth/calendarread/write访问
到日历
-
https://www.googleapis.com/auth/calendar.eventsread/write访问
活动
https://www.googleapis.com/auth/calendar.events.readonly只读
访问事件
calendar.readonly 和 calendar.events.readonly 有什么区别?
非只读的有什么区别?
如果您查阅 Google Calendar API references,您可以看到各个请求所需的范围
因此,您可以看到例如对于像 Calendars: get or CalendarList: list 这样的方法,您需要以下范围之一:
而对于 Events: list 或 Events: get
,可能的范围是:
换句话说:
https://www.googleapis.com/auth/calendar.events.readonly
比
更严格
https://www.googleapis.com/auth/calendar.readonly
前者只允许您检索事件特定信息,而不是一般日历相关信息。
然后,
如果要插入、修补或更新事件,至少需要作用域
而对于插入、修补或更新日历,您需要范围 https://www.googleapis.com/auth/calendar
根据文档 (here),Google 提供了一些相同的范围:
https://www.googleapis.com/auth/calendarread/write访问 到日历
https://www.googleapis.com/auth/calendar.eventsread/write访问 活动
https://www.googleapis.com/auth/calendar.events.readonly只读 访问事件
calendar.readonly 和 calendar.events.readonly 有什么区别? 非只读的有什么区别?
如果您查阅 Google Calendar API references,您可以看到各个请求所需的范围
因此,您可以看到例如对于像 Calendars: get or CalendarList: list 这样的方法,您需要以下范围之一:
而对于 Events: list 或 Events: get
,可能的范围是:
换句话说:
https://www.googleapis.com/auth/calendar.events.readonly
比
更严格https://www.googleapis.com/auth/calendar.readonly
前者只允许您检索事件特定信息,而不是一般日历相关信息。
然后,
如果要插入、修补或更新事件,至少需要作用域
而对于插入、修补或更新日历,您需要范围 https://www.googleapis.com/auth/calendar