Pergunta

I am using Google Apps Provisioning API to play around with google apps domains group settings. I have got the list of the all the groups in a domains but I need to know whethet a particular group is User-Managed or Admin-Managed.

I cannot see any method to get that information. I would need some help here if anybody knows about this. Thanks :)

Foi útil?

Solução

With Google Apps Script, you could get the Owner list using getAllOwners(), and check to see if the owners of the group are admins. Something like:

function isAdminManaged(groupName){
  var groupOwners = GroupsManager.getGroup(groupName).getAllOwners();
  for (var owner in groupOwners){
    var userName = groupOwners[owner];
    if(UserManager.getUser(userName).getIsAdmin()){
      return true;
    }
  }
return false;
}

Outras dicas

The provisioning API has an undocumented flag you can specify when retrieving all groups with this call:

https://developers.google.com/google-apps/provisioning/#retrieving_all_groups_in_a_domain

if you append ?skipUserCreatedGroups=True to the URI, as in:

https://apps-apis.google.com/a/feeds/group/2.0/example.com?skipUserCreatedGroups=True

then only admin-created groups will be returned. If your group isn't returned by this API call, then you know it's user managed.

Not highly efficient for checking just one group but it gets the job done.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top