Search code examples
google-bigquerygoogle-cloud-iam

Big Query give user access to a single table


I wanted to give a user the ability to view and query a single table in a much larger dataset. Is there some way to allow the user to query just that table? I know I can restrict access to datasets, but is there a way to give permissions at a table level?


Solution

  • Giving access on a per-table basis is possible in GCP now. Check https://cloud.google.com/bigquery/docs/table-access-controls-intro for more details, but essentially, you need to use the bigquery.tables.setIamPolicy directive to grant access to specific tables.

    So, for example, using the bq CLI command, you can run the following command to grant access to table xyz

    bq set-iam-policy --table=true xyz