how to control the label of one user automatically
As we know , we can use SA_USER_ADMIN.SET_USER_LABELS to control the label of one specific user manually. However, can we use a trigger to revoke the privilege of the user after the user logoff the database or re-logon the database.
I have try to do this.
create or replace trigger label_security_reset_privilege
after logon on database
declare
v_username varchar2(100);
Begin
v_username :=SYS_CONTEXT('USERENV', 'SESSION_USER');
if v_username in ('username1','username2','username3')
Then
SA_USER_ADMIN.SET_USER_LABELS('ssaccess_policy',v_username,'L1:c1:all');
end if;
I have try to do this.
create or replace trigger label_security_reset_privilege
after logon on database
declare
v_username varchar2(100);
Begin
v_username :=SYS_CONTEXT('USERENV', 'SESSION_USER');
if v_username in ('username1','username2','username3')
Then
SA_USER_ADMIN.SET_USER_LABELS('ssaccess_policy',v_username,'L1:c1:all');
end if;
0