GRANT and REVOKE statements assign or remove roles so users can query, create, or administer datasets, tables, and views in BigQuery.
GRANT and REVOKE let you control who can read, write, or administer data without exposing full project access. Use them to follow the principle of least privilege and simplify audits.
BigQuery supplies predefined roles (bigquery.dataViewer, bigquery.dataEditor, bigquery.dataOwner, bigquery.user). You can also grant custom IAM roles that bundle granular permissions like bigquery.tables.create.
Run a GRANT ON SCHEMA statement targeting the dataset. The principal can be a Google account, Google group, service account, or domain. Example:
GRANT `bigquery.dataViewer` ON SCHEMA `ecommerce.sales` TO "user:analyst@acme.com";
Use GRANT ON TABLE to allow fine-grained control. Table roles are the same as dataset roles but affect only the specified table.
GRANT `bigquery.dataViewer` ON TABLE `ecommerce.sales.Customers` TO "user:intern@acme.com";
Run REVOKE with the same syntax. Always revoke unneeded privileges when users change teams or leave the organization.
REVOKE `bigquery.dataViewer` ON SCHEMA `ecommerce.sales` FROM "user:intern@acme.com";
List dataset or table metadata withSELECT * FROM `ecommerce.sales.INFORMATION_SCHEMA.SCHEMA_PRIVILEGES`;
This reveals who has which roles.
• Grant roles to Google groups, not individuals—team membership then controls data access.
• Prefer predefined roles unless you need custom combinations.
• Audit INFORMATION_SCHEMA monthly.
• Automate revocation via Cloud Functions triggered by Cloud IAM events.
GRANT/REVOKE control object access. Combine with row-level security policies when you need to filter data per user. The policy runs only if the user first has table access.
No. Issue separate GRANT statements for each role. This keeps audits explicit.
You need bigquery.datasets.update or bigquery.tables.update on the target resource, usually via the bigquery.dataOwner role.