Now it’s time to think about row-level security. How will you restrict access to each record in this dataset?
You decide to implement the following predicate on the dataset.
'AccountOwner' == "$User.Name"
All predicate examples in this document escape the double quotes because it’s required when you enter the predicate in the Register transformation or metadata file.This predicate implements row-level security based on record ownership. Based on the predicate, Wave Analytics
returns a sales target record when the user who submits the query on the dataset is the account owner.
Let’s take a deeper look into the predicate expression:
- AccountOwner refers to the dataset column that stores the full name of the account owner for each sales target.
- $User.Name refers to the Name column of the User object that stores the full name of each user. Wave Analytics performs a lookup to get the full name of the user who submits each query.
The lookup returns a match when the names in AccountOwner and $User.Name match exactly—they must have the same case.