pl-300 Practice Question 1937
Exam: pl-300
Domain: Deploy and maintain assets
Topic: Manage files and datasets
Difficulty: medium
In a scenario where you need to ensure that only users with specific roles can access certain rows in a dataset based on their role, which feature should you implement to enforce this requirement without modifying the application code?
You have a dataset named `SalesData` and you want to restrict access so that only users in the `SalesManager` role can see sales data from their respective regions, while all other users can only see their own region's sales data.
Answer Options
A
Create a view that filters the data based on the user's role.
B
Implement Row-Level Security (RLS) by creating a policy that filters the rows based on the user's role.
C
Use a stored procedure to filter the data based on the user's role.
D
Configure the dataset to automatically filter data based on the user's role.
Correct Answer
B: Implement Row-Level Security (RLS) by creating a policy that filters the rows based on the user's role.
Explanation
Row-Level Security (RLS) is designed to enforce row-level access control policies without changing the application code. By creating an RLS policy that filters the rows based on the user's role, you can ensure that only users in the `SalesManager` role can see sales data from their respective regions, and all other users can only see their own region's sales data. Other options like using views or stored procedures would require changes to the application code, which goes against the requirement of not modifying the application code.