与域的所有用户共享模拟帐户的日历

Share a calendar of impersonated account with all users of a domain

我有一个用帐户 slave@company.tn 模拟的服务帐户。 我将 slave@company.tn 的日历插入到 service account 的日历列表中。

现在我想与域 company.tn 的所有用户共享(模拟帐户的)日历。

--> 这样日历就会出现在域中每个用户的日历列表中 company.tn

创建日历后我的代码是:

AclRule rule = new AclRule();
        Scope scope = new Scope();
        scope.setType("domain").setValue("default");
        rule.setScope(scope).setRole("reader");

        // Insert new access rule
        AclRule createdRule = service.acl().insert("slave@company.tn", rule).execute();
        System.out.println(createdRule.getId());

我的方法对吗?。 任何建议表示赞赏。 非常感谢。

你走对了,唯一的问题是线

scope.setType("domain").setValue("default");:

对于类型 domain,范围的正确值应该是域的实际名称,而不是 "default"。

请记住:不需要分配服务帐户 owner,而不是 writer 才能与域共享日历。