0
votes

I am creating a web app with Google Apps Script. I want to know if an app user is a member of Google Groups.

Group site: https://groups.google.com/

It is not groups managed by G suite.

Create a Google spreadsheet. Open this and add the group's email in the sharing task.

When I open a file shared by a group in a script and open it, can I verify that it is a member of the group?

2
I want to qualify only members of the Google Group to be members of the Google Team Drive. - user6338904
How will you access the list of users in a group? If the group is not in G-suite are you the owner of the group? - Jason Allshorn
I am the owner of the group. But it does not matter. I need a way to know the members of a group in the webapp. Here are the scenarios: I create a spreadsheet file on Google Drive. Then invite the group to view this file. I can find the group members by adding code to open the file in the Script Editor. - user6338904

2 Answers

0
votes

What's available from Google's API is the Members.list.

Retrieves a paginated list of all members in a group.

Give it a try.

Haven't really tried it but the Apps Script version seems to be getUsers().

0
votes

I don't believe this is possible. This is information you would have to get when the script executes. When the script runs, the Active User (Session.getActiveUser()) is the script owner (you), and the user returned by Session.getEffectiveUser() won't allow you to get the email address. More information at:

https://developers.google.com/apps-script/reference/base/user#getemail

Basically, this would only work on a G Suite domain.