0
votes

I'm using Ruby and the google-api-client gem to create a simple script that lists all datasets in a project and then deletes them. The script is using Service Account credentials and the BigQuery API is enabled. I am using v2 of the API.

The listing of the datasets works fine and I get the list (so it's not the credentials or the scope that has a problem) but when I try and delete that dataset I get a Access Denied: Dataset pppppppppp:foofoofoo: DELETE_DATASET.

When I look at the ACL on the dataset it is set to the defaults, namely group: Project Viewers Can View, group Project Editors Can Edit and group: Project Owners Is Owner. If I try and delete the dataset from the console by logging in with the project owner credentials, it all works fine.

Any help would be appreciated. Thx Enis

1

1 Answers

1
votes

It sounds like the service account you are using is not on the Project Writers group. Deleting a dataset owned by a project requires either Writer or Owner permissions.

Dataset permissions can be found here: https://cloud.google.com/bigquery/access-control#datasetroles