2012-03-26 248 views
2

是否有可能與某人(添加或刪除用戶),具體谷歌日曆使用谷歌API分享?谷歌日曆API - 共享日曆

我有超過50個日曆,每個人都有不同的人更新數據,我想使「更新窗口」,例如。他們只能在星期一更新活動。

回答

1

這是一個老問題,但在這裏,如果有人想用它如何與用戶共享日曆: 這是由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); 
} 

希望這有助於:)