uffa14
uffa14

Reputation: 165

Update Google Group posting permissions

I'm writing a script to manage groups, as in the group there are internal domain's addresses and other domain's addresses. I'd like to programmatically enforce that only the internal domain's users can post to the group.

I use this code:

var groupId = "[email protected]";
var groupSettings = AdminGroupsSettings.newGroups();
groupSettings.whoCanPostMessage = ["ALL_IN_DOMAIN_CAN_POST"];
AdminGroupsSettings.Groups.patch(
    groupSettings, groupId
)

But if I then check the "who can post" section in Group Management, I find:

- OWNER yes
- MANAGER yes
- ALL GROUP MEMBER yes
- ALL IN DOMAIN yes
- ANYONE no

In group management I can do this setting:

- OWNER yes
- MANAGER yes
- ALL GROUP MEMBER no
- ALL IN DOMAIN yes
- ANYONE no

But I'd like to set this via Apps Script. Why isn't my code updating the posting permission?

Upvotes: 0

Views: 192

Answers (0)

Related Questions