2

Please, help. How can I validate user's group membership? Only users of a few google groups can access some pages on the site on appengine (python).
validating group membership gives a negative answer to my question, but it was a year ago, maybe something has changed..

4

2 回答 2

1

目前没有 Google Groups API,因此无法确定用户是否是 Google Group 的成员。

于 2010-10-05T10:51:04.690 回答
0

可能会迟到,但仅适用于发现此问题的其他人,这是我的解决方案:

在驱动器中创建一个新的 AppScript,然后将其发布为 Web 服务,您可以使用以下代码来检查用户是否在组中:

// General context variables
var group = GroupsApp.getGroupByEmail("xxxx-group-name@googlegroups.com");

function doGet(request) {
var result = {
authorized: group.hasUser(request.parameter.mail)
};
return ContentService.createTextOutput(JSON.stringify(result)).setMimeType(ContentService.MimeType.JSON);
}

发布后,您将获得一个可以访问的 url,只需附加 ?mail=user@domain.com 即可查询特定电子邮件地址的组成员身份。

于 2013-03-07T23:13:30.143 回答