GRANT assigns roles or fine-grained privileges to users, groups, or service accounts on BigQuery resources.
The following gives analysts read-only access to the Ecommerce dataset:<\/p>
GRANT READER ON SCHEMA `project.ecommerce` TO "group:analysts@example.com";\n<\/code><\/pre>
Orders<\/code> without touching other tables:<\/p>
GRANT SELECT ON TABLE `project.ecommerce.Orders`\nTO "serviceAccount:billing@appspot.gserviceaccount.com";\n<\/code>
How do I revoke permissions?<\/h2>
Use the REVOKE command with the same syntax to remove a role or privilege. Always test revokes in a staging project first.<\/p>
INFORMATION_SCHEMA.<\/code> views.<\/p>
Common mistakes and fixes<\/h2>See the section below for two frequent errors and how to resolve them.<\/p>
GRANT SELECT, INSERT ON TABLE project.dataset.Products TO "group:devs@example.com";<\/code><\/p>
Does GRANT overwrite existing permissions?<\/h3>
No. GRANT appends the new role or privilege to the ACL. Use REVOKE to remove existing entries.<\/p>
project.region-us.INFORMATION_SCHEMA.TABLE_OPTIONS<\/code> or the dataset s INFORMATION_SCHEMA.SCHEMATA_OPTIONS<\/code> views.<\/p>