feat(backoffice): retain access policy with Smilegate tables
This commit is contained in:
@@ -79,6 +79,57 @@ begin
|
||||
created_at timestamp default systimestamp not null
|
||||
)');
|
||||
create_if_missing('create sequence sg_audit_event_seq start with 1 increment by 1 nocache');
|
||||
create_if_missing('create table sg_protected_object (
|
||||
object_id number primary key,
|
||||
owner varchar2(128) not null,
|
||||
object_name varchar2(128) not null,
|
||||
ords_path varchar2(500),
|
||||
enabled_yn char(1) default ''Y'' not null,
|
||||
description varchar2(500),
|
||||
created_at timestamp default systimestamp not null,
|
||||
updated_at timestamp default systimestamp not null,
|
||||
constraint sg_protected_object_uq unique (owner, object_name),
|
||||
constraint sg_protected_object_enabled_ck check (enabled_yn in (''Y'', ''N''))
|
||||
)');
|
||||
create_if_missing('create table sg_protected_column (
|
||||
column_id number primary key,
|
||||
object_id number not null,
|
||||
column_name varchar2(128) not null,
|
||||
sensitive_yn char(1) default ''N'' not null,
|
||||
visible_role_id number,
|
||||
sensitivity_level varchar2(30) default ''PUBLIC'' not null,
|
||||
redaction_method varchar2(30) default ''NONE'' not null,
|
||||
constraint sg_protected_column_uq unique (object_id, column_name),
|
||||
constraint sg_protected_column_object_fk foreign key (object_id) references sg_protected_object(object_id),
|
||||
constraint sg_protected_column_role_fk foreign key (visible_role_id) references sg_app_role(role_id)
|
||||
)');
|
||||
create_if_missing('create table sg_permission (
|
||||
perm_id number primary key,
|
||||
role_id number not null,
|
||||
target_name varchar2(128) not null,
|
||||
action_name varchar2(30) not null,
|
||||
permission_effect varchar2(30) default ''ALLOW'' not null,
|
||||
created_at timestamp default systimestamp not null,
|
||||
updated_at timestamp default systimestamp not null,
|
||||
constraint sg_permission_role_fk foreign key (role_id) references sg_app_role(role_id),
|
||||
constraint sg_permission_effect_ck check (permission_effect in (''ALLOW'', ''DENY''))
|
||||
)');
|
||||
create_if_missing('create table sg_permission_rule (
|
||||
rule_id number primary key,
|
||||
perm_id number not null,
|
||||
rule_column varchar2(128),
|
||||
rule_type varchar2(50) not null,
|
||||
rule_value varchar2(2000),
|
||||
constraint sg_permission_rule_perm_fk foreign key (perm_id) references sg_permission(perm_id)
|
||||
)');
|
||||
create_if_missing('create table sg_permission_column (
|
||||
permission_id number not null,
|
||||
column_name varchar2(128) not null,
|
||||
constraint sg_permission_column_pk primary key (permission_id, column_name),
|
||||
constraint sg_permission_column_perm_fk foreign key (permission_id) references sg_permission(perm_id)
|
||||
)');
|
||||
create_if_missing('create sequence sg_permission_seq start with 1 increment by 1 nocache');
|
||||
create_if_missing('create sequence sg_permission_rule_seq start with 1 increment by 1 nocache');
|
||||
end;
|
||||
/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user