How to Give Users Access to Only Certain Tables in BigQuery
When managing a BigQuery project across different websites and partners, you will almost certainly have received a request where you need to give someone access to one particular table.
BigQuery’s permission model is built around projects, datasets, and tables, in that order. By default, access granted at the dataset level applies to every table inside it. Giving access to particular tables has been known to be tricky, but fortunately there a few ways in which you can achieve this.
Method 1: IAM permissions on the table itself
BigQuery lets you set an IAM policy directly on an individual table, separate from the dataset it lives in. This is the most direct way to say “this person can see this table, and nothing else in this dataset”.
In the console:
- Open BigQuery and expand the dataset in the Explorer pane.
- Right-click the specific table and select Sharing, then Permissions.
- Click Add principal.
- Enter the user, group, or service account.
- Choose a role. BigQuery Data Viewer (
roles/bigquery.dataViewer) is the right choice for read-only access. Use BigQuery Data Editor if they also need to write to the table. - Save.
In Terraform, if you are managing access as code:
resource "google_bigquery_table_iam_member" "analyst_read_access" {
project = "my-project"
dataset_id = "sales"
table_id = "orders"
role = "roles/bigquery.dataViewer"
member = "group:analysts@example.com"
}
Setting or reading these policies requires bigquery.tables.setIamPolicy and bigquery.tables.getIamPolicy, which the BigQuery Data Owner role includes.
One limitation matters here: a user with table-level access only, and no dataset-level access, can query the table directly, but they usually cannot browse to it in the console, meaning the best thing to do is provide them with the table ID directly.
It is also worth noting that tables inside external or linked datasets do not support table-level access controls at all. If your data lives in an external dataset, you will need one of the other methods below.
Method 2: Authorised views, for sharing part of a table
Table-level IAM controls whether someone can see the whole table. It does not let you show them some columns and hide others, or show them a filtered slice of the data. For that, you want an authorised view.
An authorised view is a saved query that acts as its own object with its own permissions. You grant someone access to the view, not to the table underneath it. They can query the view and get results, but they cannot query the source table directly, and they never see columns or rows you left out of the view’s SQL.
The setup:
- Create the view in its own dataset, separate from the source data. This matters, because permissions are authorised at the dataset level for this purpose.
- Write the view’s query to include only the columns (and, with a
WHEREclause, only the rows) you want visible. - Authorise the view: from the source dataset’s sharing settings, add the view’s dataset as an authorised view source.
- Grant the people who need access
roles/bigquery.dataVieweron the view’s dataset, plusroles/bigquery.jobUserat the project level so they can actually run queries.
Once that is done, someone can run SELECT * FROM view_dataset.customer_summary_view and get back exactly the columns you defined, with no path to the underlying table.
If you have several views that all need to reach the same source data, an authorised dataset does the same job for a whole dataset of views at once, rather than authorising each view individually. You authorise the dataset once, and every current and future view inside it inherits access to the source data. Set this up if you are building anything with more than two or three views on the same source, since re-authorising each new view by hand does not scale.
Method 3: Row-level security, when everyone needs the same table but different rows
Sometimes the problem is not that someone should be blocked from a table entirely. An example could be a that regional user should only see their own region’s rows, out of a table that holds every region’s data.
BigQuery’s row access policies handle this with a filter, defined directly on the table:
CREATE ROW ACCESS POLICY region_filter
ON `my-project.sales.orders`
GRANT TO ("group:emea-sales@example.com")
FILTER USING (region = "EMEA");
Anyone in that group querying the table only ever sees rows where region = "EMEA". Other users, or users covered by a different row access policy, see a different slice. If someone has no matching policy and no other access path, they see nothing, even if they can technically query the table.
One thing that is important to get right: row-level security only filters rows for someone who already has basic access to query the table. It is a second layer on top of table access, not a replacement for it. Grant the underlying bigquery.tables.getData permission first, and then add the row access policy on top.
Method 4: Column-level security for masking sensitive fields
If the problem is a handful of sensitive columns rather than whole rows, column-level security is the right tool. As an example, a customer table where everyone needs the address and order history but almost nobody should see the raw email or phone number.
This works through data policy tags: you tag specific columns in a table’s schema, then set a masking or access policy against that tag. Someone without the right permission on the tag can still query the table and get every other column back. The tagged column returns a masked value, or an error, depending on how you configured it.
Google shipped IAM Data Governance Tags in mid-2026 as the current version of this. It replaces the older regional policy tag system with a global, org-level one that supports up to five levels of tag hierarchy. As of August 2026, these tags and their masking policies can also be defined in Terraform.
Which method for which situation
A rough guide, based on what you are actually trying to restrict:
- Someone should see this table and nothing else in the dataset: Table-level IAM.
- Someone should see part of a table, specific columns or a filtered slice, and never touch the raw table: An authorised view.
- Several views all need to reach the same underlying data: An authorised dataset.
- Everyone needs the same table, but different people should see different rows: Row-level security.
- Everyone needs the same table, but a few columns are sensitive: Column-level security with data policy tags.
- You want project- or dataset-level convenience for a role, but restricted to one specific resource: An IAM Condition, which lets you attach a role like
roles/bigquery.dataViewerwith an expression that limits it to a named table:
resource.name == "projects/my-project/datasets/sales/tables/orders"
&& resource.type == "bigquery.googleapis.com/Table"
Newsletter
Occasional notes on data, tracking & AI-readiness
No spam, no growth-hacking. Just an email when there's something worth reading.