To enable BigQuery row-level security, you can follow these steps:
- Go to the BigQuery console and select the Datasets tab.
- Click the name of the dataset that you want to enable row-level security for.
- Click the Security tab.
- Click the Row-level security tab.
- Click the Create policy button.
- In the Create policy dialog, enter a name for your policy.
- In the Principals section, select the users or groups that you want to grant access to the data.
- In the Filter section, enter a SQL filter that defines the rows that the users or groups will be able to access.
- Click the Create button.
Once you have created a row-level security policy, users or groups that are not included in the policy will not be able to access the data in the table.
Here are some additional things to keep in mind when enabling row-level security:
- Row-level security policies can coexist on a table with column-level security as well as dataset-level, table-level, and project-level access controls.
- If you create a new row-level security policy to limit row access, users that previously had full access must be added to a TRUE filter to maintain their access.
- Row-level security is enforced at query time, so users will only see the rows that they are authorized to access when they run queries against the table.
For more information on row-level security in BigQuery, please see the official documentation: https://cloud.google.com/bigquery/docs/row-level-security-intro.