You are here:
Row-Level Security Example based on Record Ownership
Let’s look at an example where you create a dataset based on a CSV file and then implement row-level security based on record ownership. In this example, you will create a dataset that contains sales targets for account owners. To restrict access on each record in the dataset, you will create a security policy where each user can view only sales targets for accounts that they own. This process requires multiple steps that are described in the sections that follow.
- Determine Which Data to Include in the Dataset
First, determine what data you want to include in the dataset. For this example, you will create a Targets dataset that contains all sales targets. - Determine Row-Level Security for Dataset
Now it’s time to think about row-level security. How will you restrict access to each record in this dataset? - Add the Predicate to the Metadata File
For a dataset created from a CSV file, you can specify the predicate in the metadata file associated with the CSV file or when you edit the dataset. - Create the Dataset
Now that you updated the metadata file with the predicate, you can create the dataset. - Test Row-Level Security for the Dataset
You must verify that the predicate is applied properly and that each user can see their own sales targets.

