Using trusted stored units
Trusted stored units are usually used to allow specific users to perform operations on tables protected by labels. In this recipe, we will grant the READ
privilege on a specific result set to the user SMAVRIS
, through a trusted stored unit.
Getting ready
All the steps will be performed on the database HACKDB
.
How to do it...
We grant the READ
privilege to the user SMAVRIS
, on a specific result set, using the trusted stored unit as follows:
- We will create a function which returns a result set from
EMPLOYEES_OLS_TBL
. Connect as the userHR
and create the functionols_tru_stored_unit
as follows:SQL> conn HR Enter password: Connected. SQL> create or replace function ols_tru_store_unit RETURN sys_refcursor 2 is 3 ret_cur sys_refcursor; ...
Get Oracle 11g Anti-hacker's Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.