DATA redaction expression to redact data for particular users(assigned with supervisor role) not wor
1) BEGIN
DBMS_REDACT.add_policy(
object_schema => 'test_redact',
object_name => 'CMC_STTM_DATES',
column_name => 'BRANCH_CODE',
policy_name => 'redact_date_info',
function_type => DBMS_REDACT.full,
expression => 'SYS_CONTEXT('SYS_SESSION_ROLES', 'SUPERVISOR') = 'FALSE''
);
END;
/
2) BEGIN
DBMS_REDACT.add_policy(
object_schema => 'test_redact',
object_name => 'CMC_DUPLICATE_FIELDS',
column_name => 'FUNCTIONID',
policy_name => 'redact_fnid_info',
function_type => DBMS_REDACT.full,
expression => 'SYS_CONTEXT(''USERENV'', ''SESSION_USER'') != ''SUPERVISOR'''
);
END;
/
I used the following 2 redaction methods to exempt redaction for users with supervisor role in 1 and 2 (user test_redact has supervisor role but test_redact can see redacted data only ,once i granted test_redact EXEMPT redaction policy privileges test_redact user is able to see data without redaction but applicable to all tables. What if i want to give redaction to only certain tables to user