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

Google calendar api 谷歌日历api-共享日历,google-calendar-api,Google Calendar Api,是否可以使用谷歌api与某人(添加或删除用户)共享特定的谷歌日历 我有50多个日历,每个日历都有不同的人更新数据,我想创建“更新窗口”,例如,他们只能在周一更新事件。您可以通过查看ACL的API文档-访问控制列表来实现这一点 这是一个老问题,但如果有人想使用日历,下面是如何与用户共享日历: 这是由 以下是php中的一个示例: public function sharecalendarwithuser($calendar_id, $user_email, $role) { $rule =

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


我有50多个日历,每个日历都有不同的人更新数据,我想创建“更新窗口”,例如,他们只能在周一更新事件。

您可以通过查看ACL的API文档-访问控制列表来实现这一点

这是一个老问题,但如果有人想使用日历,下面是如何与用户共享日历: 这是由 以下是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);
}

希望这有帮助:)

链接不再有效