2013-01-18 32 views
0

我遵循的指南在这里 - >http://framework.zend.com/manual/1.12/en/zend.gdata.gapps.html#zend.gdata.gapps.groups.creating。我正在尝试创建一个组并为其指定一个“访问级别”,但没有关于可接受值的文档。Google Groups - Zend API - 设置访问级别

这里是我写的剧本:

<?php 

// This should point to the exact path of the file being imported 
require_once '/Users/myuser/Source/Zend/Loader.php'; 
Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); 
Zend_Loader::loadClass('Zend_Gdata_Gapps'); 

if (count($argv) == 1) { 
    echo "Usage: ".$argv[0]." \"group id\" \"group name\" \"description\" \"email permission\"\n"; 
    die; 
} 

// Arguments passed in on the command line 
$groupId = $argv[1]; 
$groupName = $argv[2]; 
$groupDesc = null; 
if (count($argv) > 3) { 
    $groupDesc = $argv[3]; 
} 
$groupPermission = null; 
if (count($argv) > 4) { 
    $groupPermission = $argv[4]; 
} 

// Set this to your gapps email/pass 
$email = "[email protected]"; 
$password = "foobar"; 
// Gapps domain 
$domain = "domain.com"; 

$client = Zend_Gdata_ClientLogin::getHttpClient($email, $password, Zend_Gdata_Gapps::AUTH_SERVICE_NAME); 
$gdata = new Zend_Gdata_Gapps($client, $domain); 

$entry = $gdata->createGroup($groupId, $groupName, $groupDesc, $groupPermission); 
?> 

在Gapps.php文件 “createGroup” 的描述如下:

/** 
* Create a new group. 
* @param string $groupId A unique identifier for the group 
* @param string $groupName The name of the group 
* @param string $description A description of the group 
* @param string $emailPermission The subscription permission of the group 
* @return Zend_Gdata_Gapps_GroupEntry The group entry as created on the server. 
* 

如果你在谷歌Apps的期待“的角色下&权限“有4个访问级别定义:团队,公告,限制,自定义。我无法在成功将组设置为除“自定义”之外的任何内容的emailPermission字段中发送值。到目前为止,我可以发送“所有者”或“成员”,并且选择“自定义”的访问级别,并在“发送电子邮件到群组旁边”旁边选中“所有者”或“成员”。与此同时,您必须拥有超级管理员权限并启用配置api才能对您的gapps域执行此脚本。

回答

0

可接受的值是所有者,成员,域和任何人。由于此API调用是在Provisioning API 2.0中发布的,因此Google Groups已获得许多更好的粒度权限,其中一些权限可通过Groups Settings API访问。如果您希望自定义组权限超出基本所有者,成员,域和任何人的默认权限,请使用组设置API。