2
votes

When we create a dataset in Google big query, by default that dataset is shared by the following access groups: "project Owners", project Editors" "project Viewers".

Is it possible to get/know the members in those access groups or any specific big query API we can use to get the member's list in the Access groups.

2

2 Answers

1
votes

You need to enable: Cloud User Accounts API. After that you can use the Users:list API call to obtain the list of users of a project.

https://cloud.google.com/compute/docs/access/user-accounts/api/latest/users/list

For a BigQuery dataset you can use the API calls under Dataset:

https://cloud.google.com/bigquery/docs/reference/v2/datasets#resource

access[] list [Optional] An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following entities:

access.specialGroup: projectReaders; access.role: READER; 
access.specialGroup: projectWriters; access.role: WRITER; 
access.specialGroup: projectOwners; access.role: OWNER; 
access.userByEmail: [dataset creator email]; access.role: OWNER;
0
votes

To get roles/members for given projectID use (from Google Cloud Resource Manager APIs):

POST https://cloudresourcemanager.googleapis.com/v1beta1/projects/projectID:getIamPolicy

To get roles/members for given datasetID use (from BigQuery API):

GET https://www.googleapis.com/bigquery/v2/projects/projectID/datasets/datasetID