Creating different policy functions
The purpose of a policy function is to return a predicate that will be applied in WHERE
clause of the statement (except for INSERT
operation). In this recipe, you'll create several simple policy functions, based on different business and security requirements.
Getting ready
To complete this recipe, you'll need to create the table hr.emp_vpd_test
, insert several values into that table, and create several users (in our case, susan
, joel
, emma
, maja
, and zoran
already exist).
If you won't use the same data as shown in Figure 4, then keep in mind to accordingly make changes in the How to do it section and the rest of the recipes in this chapter.
How to do it...
Connect to the database as a user who has appropriate privileges (for example, user
maja
):$ sqlplus maja
Create a policy function that satisfies this condition: The user
susan
can't access data in a table (for example,hr.emp_vpd_test...