首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Google日历api -共享日历

Google日历api -共享日历
EN

Stack Overflow用户
提问于 2012-03-26 19:19:07
回答 2查看 5.3K关注 0票数 7

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

我有超过50个日历,每个有不同的人更新数据,我想使“更新窗口”,例如。他们只能在星期一更新事件。

EN

回答 2

Stack Overflow用户

发布于 2018-02-22 18:37:51

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

代码语言:javascript
复制
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);
}

希望这能有所帮助:)

票数 4
EN

Stack Overflow用户

发布于 2012-04-23 09:28:29

您可以通过查看API Docs for ACL - access control list https://developers.google.com/calendar/v3/reference/acl

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9871137

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档