gpt4 book ai didi

google-calendar-api - 谷歌日历 api - 共享日历

转载 作者:行者123 更新时间:2023-12-04 11:56:56 25 4
gpt4 key购买 nike

是否可以使用 google api 与某人(添加或删除用户)共享特定的 google 日历?

我有 50 多个日历,对于每个更新数据的人,我想制作“更新窗口”,例如。他们只能在星期一更新事件。

最佳答案

这是一个老问题,但如果有人想使用它,这里是如何与用户共享日历:
这是由 ACL 完成的
这是php中的一个例子:

public function sharecalendarwithuser($calendar_id, $user_email, $role)
{
$rule = new Google_Service_Calendar_AclRule();
$scope = new Google_Service_Calendar_AclRuleScope();
/*
The type of the scope. Possible values are:

"default" - The public scope. This is the default value.
"user" - Limits the scope to a single user.
"group" - Limits the scope to a group.
"domain" - Limits the scope to a domain.
*/
$scope->setType("user");
$scope->setValue($user_email);
$rule->setScope($scope);
/*
The role assigned to the scope. Possible values are:
"none" - Provides no access.
"freeBusyReader" - Provides read access to free/busy information.
"reader" - Provides read access to the calendar. Private events will appear to users with reader access, but event details will be hidden.
"writer" - Provides read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible.
"owner" - Provides ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs.
*/
$rule->setRole($role);
$createdRule = $service->acl->insert($calendar_id, $rule);
}

希望这有帮助:)

关于google-calendar-api - 谷歌日历 api - 共享日历,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9871137/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com