Skip to content

Commit 04cb1dc

Browse files
committed
RANGER-4274: updated security-zones to support admin-roles and audit-roles
1 parent 6cd4e8f commit 04cb1dc

File tree

23 files changed

+835
-96
lines changed

23 files changed

+835
-96
lines changed

agents-common/src/main/java/org/apache/ranger/plugin/errors/ValidationErrorCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public enum ValidationErrorCode {
111111
SECURITY_ZONE_VALIDATION_ERR_MISSING_FIELD(3035, "Internal error: missing field[{0}]"),
112112
SECURITY_ZONE_VALIDATION_ERR_ZONE_NAME_CONFLICT(3036, "Another security zone already exists for this name: zone-id=[{0}]]"),
113113
SECURITY_ZONE_VALIDATION_ERR_INVALID_ZONE_ID(3037, "No security zone found for [{0}]"),
114-
SECURITY_ZONE_VALIDATION_ERR_MISSING_USER_AND_GROUPS(3038, "both users and user-groups collections for the security zone were null/empty"),
114+
SECURITY_ZONE_VALIDATION_ERR_MISSING_USER_AND_GROUPS_AND_ROLES(3038, "users, user-groups and roles collections for the security zone were null/empty"),
115115
SECURITY_ZONE_VALIDATION_ERR_MISSING_RESOURCES(3039, "No resources specified for service [{0}]"),
116116
SECURITY_ZONE_VALIDATION_ERR_INVALID_SERVICE_NAME(3040, "Invalid service [{0}]"),
117117
SECURITY_ZONE_VALIDATION_ERR_INVALID_SERVICE_TYPE(3041, "Invalid service-type [{0}]"),

agents-common/src/main/java/org/apache/ranger/plugin/model/RangerSecurityZone.java

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,29 @@ public class RangerSecurityZone extends RangerBaseModelObject implements java.io
4444
private List<String> tagServices;
4545
private List<String> adminUsers;
4646
private List<String> adminUserGroups;
47+
private List<String> adminRoles;
4748
private List<String> auditUsers;
4849
private List<String> auditUserGroups;
50+
private List<String> auditRoles;
4951
private String description;
5052

5153
public RangerSecurityZone() {
52-
this(null, null, null, null, null, null, null,null);
54+
this(null, null, null, null, null, null, null,null, null, null);
5355
}
5456

5557
public RangerSecurityZone(String name, Map<String, RangerSecurityZoneService> services,List<String> tagServices, List<String> adminUsers, List<String> adminUserGroups, List<String> auditUsers, List<String> auditUserGroups, String description) {
58+
this(name, services, tagServices, adminUsers, adminUserGroups, null, adminUsers, adminUserGroups, null, description);
59+
}
60+
61+
public RangerSecurityZone(String name, Map<String, RangerSecurityZoneService> services,List<String> tagServices, List<String> adminUsers, List<String> adminUserGroups, List<String> adminRoles, List<String> auditUsers, List<String> auditUserGroups, List<String> auditRoles, String description) {
5662
setName(name);
5763
setServices(services);
5864
setAdminUsers(adminUsers);
5965
setAdminUserGroups(adminUserGroups);
66+
setAdminRoles(adminRoles);
6067
setAuditUsers(auditUsers);
6168
setAuditUserGroups(auditUserGroups);
69+
setAuditRoles(auditRoles);
6270
setDescription(description);
6371
setTagServices(tagServices);
6472
}
@@ -92,6 +100,12 @@ public void setAdminUserGroups(List<String> adminUserGroups) {
92100
this.adminUserGroups = adminUserGroups == null ? new ArrayList<>() : adminUserGroups;
93101
}
94102

103+
public List<String> getAdminRoles() { return adminRoles; }
104+
105+
public void setAdminRoles(List<String> adminRoles) {
106+
this.adminRoles = adminRoles == null ? new ArrayList<>() : adminRoles;
107+
}
108+
95109
public List<String> getAuditUsers() { return auditUsers; }
96110

97111
public void setAuditUsers(List<String> auditUsers) {
@@ -104,6 +118,12 @@ public void setAuditUserGroups(List<String> auditUserGroups) {
104118
this.auditUserGroups = auditUserGroups == null ? new ArrayList<>() : auditUserGroups;
105119
}
106120

121+
public List<String> getAuditRoles() { return auditRoles; }
122+
123+
public void setAuditRoles(List<String> auditRoles) {
124+
this.auditRoles = auditRoles == null ? new ArrayList<>() : auditRoles;
125+
}
126+
107127
public List<String> getTagServices() {
108128
return tagServices;
109129
}
@@ -119,8 +139,10 @@ public String toString() {
119139
+ ", tagServices=" + tagServices
120140
+ ", adminUsers=" + adminUsers
121141
+ ", adminUserGroups=" + adminUserGroups
142+
+ ", adminRoles=" + adminRoles
122143
+ ", auditUsers=" + auditUsers
123144
+ ", auditUserGroups=" + auditUserGroups
145+
+ ", auditRoles=" + auditRoles
124146
+ ", description="+ description
125147
+"}";
126148
}

agents-common/src/main/java/org/apache/ranger/plugin/model/validation/RangerSecurityZoneValidator.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,18 @@ private boolean validateWithinSecurityZone(RangerSecurityZone securityZone, Acti
233233
failures.add(new ValidationFailureDetailsBuilder().becauseOf("security zone services").isMissing().field("services").errorCode(error.getErrorCode()).becauseOf(error.getMessage(securityZone.getName())).build());
234234
ret = false;
235235
}
236-
// both admin users and user-groups collections can't be empty
237-
if (CollectionUtils.isEmpty(securityZone.getAdminUsers()) && CollectionUtils.isEmpty(securityZone.getAdminUserGroups())) {
238-
ValidationErrorCode error = ValidationErrorCode.SECURITY_ZONE_VALIDATION_ERR_MISSING_USER_AND_GROUPS;
236+
// admin users, user-groups and roles collections can't be empty
237+
if (CollectionUtils.isEmpty(securityZone.getAdminUsers()) && CollectionUtils.isEmpty(securityZone.getAdminUserGroups()) && CollectionUtils.isEmpty(securityZone.getAdminRoles())) {
238+
ValidationErrorCode error = ValidationErrorCode.SECURITY_ZONE_VALIDATION_ERR_MISSING_USER_AND_GROUPS_AND_ROLES;
239239

240-
failures.add(new ValidationFailureDetailsBuilder().field("security zone admin users/user-groups").isMissing().becauseOf(error.getMessage()).errorCode(error.getErrorCode()).build());
240+
failures.add(new ValidationFailureDetailsBuilder().field("security zone admin users/user-groups/roles").isMissing().becauseOf(error.getMessage()).errorCode(error.getErrorCode()).build());
241241
ret = false;
242242
}
243-
// both audit users and user-groups collections can't be empty
244-
if (CollectionUtils.isEmpty(securityZone.getAuditUsers()) && CollectionUtils.isEmpty(securityZone.getAuditUserGroups())) {
245-
ValidationErrorCode error = ValidationErrorCode.SECURITY_ZONE_VALIDATION_ERR_MISSING_USER_AND_GROUPS;
243+
// audit users, user-groups and roles collections can't be empty
244+
if (CollectionUtils.isEmpty(securityZone.getAuditUsers()) && CollectionUtils.isEmpty(securityZone.getAuditUserGroups()) && CollectionUtils.isEmpty(securityZone.getAuditRoles())) {
245+
ValidationErrorCode error = ValidationErrorCode.SECURITY_ZONE_VALIDATION_ERR_MISSING_USER_AND_GROUPS_AND_ROLES;
246246

247-
failures.add(new ValidationFailureDetailsBuilder().field("security zone audit users/user-groups").isMissing().becauseOf(error.getMessage()).errorCode(error.getErrorCode()).build());
247+
failures.add(new ValidationFailureDetailsBuilder().field("security zone audit users/user-groups/roles").isMissing().becauseOf(error.getMessage()).errorCode(error.getErrorCode()).build());
248248
ret = false;
249249
}
250250

intg/src/main/python/apache_ranger/model/ranger_security_zone.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ def __init__(self, attrs=None):
4747
self.tagServices = attrs.get('tagServices')
4848
self.adminUsers = attrs.get('adminUsers')
4949
self.adminUserGroups = attrs.get('adminUserGroups')
50+
self.adminRoles = attrs.get('adminRoles')
5051
self.auditUsers = attrs.get('auditUsers')
5152
self.auditUserGroups = attrs.get('auditUserGroups')
53+
self.auditRoles = attrs.get('auditRoles')
5254
self.description = attrs.get('description')
5355

5456
def type_coerce_attrs(self):

security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ DROP TABLE IF EXISTS `x_service_config_def`;
6767
DROP TABLE IF EXISTS `x_policy`;
6868
DROP TABLE IF EXISTS `x_security_zone_ref_group`;
6969
DROP TABLE IF EXISTS `x_security_zone_ref_user`;
70+
DROP TABLE IF EXISTS `x_security_zone_ref_role`;
7071
DROP TABLE IF EXISTS `x_security_zone_ref_tag_srvc`;
7172
DROP TABLE IF EXISTS `x_security_zone_ref_service`;
7273
DROP TABLE IF EXISTS `x_ranger_global_state`;
@@ -1542,6 +1543,22 @@ CREATE TABLE IF NOT EXISTS `x_role_ref_role`(
15421543
CONSTRAINT `x_role_ref_role_FK_role_ref_id` FOREIGN KEY (`role_ref_id`) REFERENCES `x_role` (`id`)
15431544
)ROW_FORMAT=DYNAMIC;
15441545

1546+
CREATE TABLE IF NOT EXISTS `x_security_zone_ref_role`(
1547+
`id` bigint(20) NOT NULL AUTO_INCREMENT,
1548+
`create_time` datetime NULL DEFAULT NULL,
1549+
`update_time` datetime NULL DEFAULT NULL,
1550+
`added_by_id` bigint(20) NULL DEFAULT NULL,
1551+
`upd_by_id` bigint(20) NULL DEFAULT NULL,
1552+
`zone_id` bigint(20) NULL DEFAULT NULL,
1553+
`role_id` bigint(20) NULL DEFAULT NULL,
1554+
`role_name` varchar(255) NULL DEFAULT NULL,
1555+
PRIMARY KEY (`id`),
1556+
CONSTRAINT `x_sz_ref_role_FK_added_by_id` FOREIGN KEY (`added_by_id`) REFERENCES `x_portal_user` (`id`),
1557+
CONSTRAINT `x_sz_ref_role_FK_upd_by_id` FOREIGN KEY (`upd_by_id`) REFERENCES `x_portal_user` (`id`),
1558+
CONSTRAINT `x_sz_ref_role_FK_zone_id` FOREIGN KEY (`zone_id`) REFERENCES `x_security_zone` (`id`),
1559+
CONSTRAINT `x_sz_ref_role_FK_role_id` FOREIGN KEY (`role_id`) REFERENCES `x_role` (`id`)
1560+
)ROW_FORMAT=DYNAMIC;
1561+
15451562
CREATE TABLE IF NOT EXISTS `x_tag_change_log` (
15461563
`id` bigint(20) NOT NULL AUTO_INCREMENT,
15471564
`create_time` datetime NULL DEFAULT NULL,
@@ -1814,6 +1831,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
18141831
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('059',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
18151832
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('060',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
18161833
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('065',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
1834+
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('075',UTC_TIMESTAMP(),'Ranger 3.0.0',UTC_TIMESTAMP(),'localhost','Y');
18171835
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
18181836

18191837
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('J10001',UTC_TIMESTAMP(),'Ranger 1.0.0',UTC_TIMESTAMP(),'localhost','Y');
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
-- Licensed to the Apache Software Foundation (ASF) under one or more
2+
-- contributor license agreements. See the NOTICE file distributed with
3+
-- this work for additional information regarding copyright ownership.
4+
-- The ASF licenses this file to You under the Apache License, Version 2.0
5+
-- (the "License"); you may not use this file except in compliance with
6+
-- the License. You may obtain a copy of the License at
7+
--
8+
-- http://www.apache.org/licenses/LICENSE-2.0
9+
--
10+
-- Unless required by applicable law or agreed to in writing, software
11+
-- distributed under the License is distributed on an "AS IS" BASIS,
12+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
-- See the License for the specific language governing permissions and
14+
-- limitations under the License.
15+
16+
DROP TABLE IF EXISTS `x_security_zone_ref_role`;
17+
18+
CREATE TABLE IF NOT EXISTS `x_security_zone_ref_role`(
19+
`id` bigint(20) NOT NULL AUTO_INCREMENT,
20+
`create_time` datetime NULL DEFAULT NULL,
21+
`update_time` datetime NULL DEFAULT NULL,
22+
`added_by_id` bigint(20) NULL DEFAULT NULL,
23+
`upd_by_id` bigint(20) NULL DEFAULT NULL,
24+
`zone_id` bigint(20) NULL DEFAULT NULL,
25+
`role_id` bigint(20) NULL DEFAULT NULL,
26+
`role_name` varchar(255) NULL DEFAULT NULL,
27+
PRIMARY KEY (`id`),
28+
CONSTRAINT `x_sz_ref_role_FK_added_by_id` FOREIGN KEY (`added_by_id`) REFERENCES `x_portal_user` (`id`),
29+
CONSTRAINT `x_sz_ref_role_FK_upd_by_id` FOREIGN KEY (`upd_by_id`) REFERENCES `x_portal_user` (`id`),
30+
CONSTRAINT `x_sz_ref_role_FK_zone_id` FOREIGN KEY (`zone_id`) REFERENCES `x_security_zone` (`id`),
31+
CONSTRAINT `x_sz_ref_role_FK_role_id` FOREIGN KEY (`role_id`) REFERENCES `x_role` (`id`)
32+
)ROW_FORMAT=DYNAMIC;

security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ call spdroptable('x_service_config_def');
257257
call spdroptable('x_policy');
258258
call spdroptable('x_security_zone_ref_group');
259259
call spdroptable('x_security_zone_ref_user');
260+
call spdroptable('x_security_zone_ref_role');
260261
call spdroptable('x_security_zone_ref_tag_srvc');
261262
call spdroptable('x_security_zone_ref_service');
262263
call spdroptable('x_ranger_global_state');
@@ -1641,6 +1642,23 @@ CONSTRAINT x_sz_ref_res_FK_res_def_id FOREIGN KEY (resource_def_id) REFERENCES x
16411642
);
16421643
commit;
16431644

1645+
CREATE TABLE x_security_zone_ref_role (
1646+
id NUMBER(20) NOT NULL,
1647+
create_time DATE DEFAULT NULL NULL,
1648+
update_time DATE DEFAULT NULL NULL,
1649+
added_by_id NUMBER(20) DEFAULT NULL NULL,
1650+
upd_by_id NUMBER(20) DEFAULT NULL NULL,
1651+
zone_id NUMBER(20) DEFAULT NULL NULL,
1652+
role_id NUMBER(20) DEFAULT NULL NULL,
1653+
role_name varchar(255) DEFAULT NULL NULL,
1654+
primary key (id),
1655+
CONSTRAINT x_sz_ref_role_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
1656+
CONSTRAINT x_sz_ref_role_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id),
1657+
CONSTRAINT x_sz_ref_role_FK_zone_id FOREIGN KEY (zone_id) REFERENCES x_security_zone (id),
1658+
CONSTRAINT x_sz_ref_role_FK_role_id FOREIGN KEY (role_id) REFERENCES x_role (id)
1659+
);
1660+
commit;
1661+
16441662
CREATE VIEW vx_trx_log AS select x_trx_log.id AS id,x_trx_log.create_time AS create_time,x_trx_log.update_time AS update_time,x_trx_log.added_by_id AS added_by_id,x_trx_log.upd_by_id AS upd_by_id,x_trx_log.class_type AS class_type,x_trx_log.object_id AS object_id,x_trx_log.parent_object_id AS parent_object_id,x_trx_log.parent_object_class_type AS parent_object_class_type,x_trx_log.attr_name AS attr_name,x_trx_log.parent_object_name AS parent_object_name,x_trx_log.object_name AS object_name,x_trx_log.prev_val AS prev_val,x_trx_log.new_val AS new_val,x_trx_log.trx_id AS trx_id,x_trx_log.action AS action,x_trx_log.sess_id AS sess_id,x_trx_log.req_id AS req_id,x_trx_log.sess_type AS sess_type from x_trx_log where id in(select min(x_trx_log.id) from x_trx_log group by x_trx_log.trx_id);
16451663
commit;
16461664

@@ -1974,6 +1992,7 @@ INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,act
19741992
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '059',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
19751993
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '060',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
19761994
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '065',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
1995+
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, '075',sys_extract_utc(systimestamp),'Ranger 3.0.0',sys_extract_utc(systimestamp),'localhost','Y');
19771996
INSERT INTO x_db_version_h (id,version,inst_at,inst_by,updated_at,updated_by,active) VALUES (X_DB_VERSION_H_SEQ.nextval, 'DB_PATCHES',sys_extract_utc(systimestamp),'Ranger 1.0.0',sys_extract_utc(systimestamp),'localhost','Y');
19781997

19791998
INSERT INTO x_user_module_perm (id,user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES (X_USER_MODULE_PERM_SEQ.nextval,getXportalUIdByLoginId('admin'),getModulesIdByName('Reports'),sys_extract_utc(systimestamp),sys_extract_utc(systimestamp),getXportalUIdByLoginId('admin'),getXportalUIdByLoginId('admin'),1);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-- Licensed to the Apache Software Foundation (ASF) under one or more
2+
-- contributor license agreements. See the NOTICE file distributed with
3+
-- this work for additional information regarding copyright ownership.
4+
-- The ASF licenses this file to You under the Apache License, Version 2.0
5+
-- (the "License"); you may not use this file except in compliance with
6+
-- the License. You may obtain a copy of the License at
7+
--
8+
-- http://www.apache.org/licenses/LICENSE-2.0
9+
--
10+
-- Unless required by applicable law or agreed to in writing, software
11+
-- distributed under the License is distributed on an "AS IS" BASIS,
12+
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
-- See the License for the specific language governing permissions and
14+
-- limitations under the License.
15+
16+
call spdroptable('x_security_zone_ref_role');
17+
18+
CREATE TABLE x_security_zone_ref_role (
19+
id NUMBER(20) NOT NULL,
20+
create_time DATE DEFAULT NULL NULL,
21+
update_time DATE DEFAULT NULL NULL,
22+
added_by_id NUMBER(20) DEFAULT NULL NULL,
23+
upd_by_id NUMBER(20) DEFAULT NULL NULL,
24+
zone_id NUMBER(20) DEFAULT NULL NULL,
25+
role_id NUMBER(20) DEFAULT NULL NULL,
26+
role_name varchar(255) DEFAULT NULL NULL,
27+
primary key (id),
28+
CONSTRAINT x_sz_ref_role_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
29+
CONSTRAINT x_sz_ref_role_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id),
30+
CONSTRAINT x_sz_ref_role_FK_zone_id FOREIGN KEY (zone_id) REFERENCES x_security_zone (id),
31+
CONSTRAINT x_sz_ref_role_FK_role_id FOREIGN KEY (role_id) REFERENCES x_role (id)
32+
);
33+
commit;

security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ DROP TABLE IF EXISTS x_service_config_def CASCADE;
6666
DROP TABLE IF EXISTS x_policy CASCADE;
6767
DROP TABLE IF EXISTS x_security_zone_ref_group CASCADE;
6868
DROP TABLE IF EXISTS x_security_zone_ref_user CASCADE;
69+
DROP TABLE IF EXISTS x_security_zone_ref_role CASCADE;
6970
DROP TABLE IF EXISTS x_security_zone_ref_tag_srvc CASCADE;
7071
DROP TABLE IF EXISTS x_security_zone_ref_service CASCADE;
7172
DROP TABLE IF EXISTS x_ranger_global_state CASCADE;
@@ -92,6 +93,7 @@ DROP TABLE IF EXISTS x_db_version_h CASCADE;
9293

9394
DROP SEQUENCE IF EXISTS x_sec_zone_ref_group_seq;
9495
DROP SEQUENCE IF EXISTS x_sec_zone_ref_user_seq;
96+
DROP SEQUENCE IF EXISTS x_sec_zone_ref_role_seq;
9597
DROP SEQUENCE IF EXISTS x_sec_zone_ref_resource_seq;
9698
DROP SEQUENCE IF EXISTS x_sec_zone_ref_service_seq;
9799
DROP SEQUENCE IF EXISTS x_sec_zone_ref_tag_srvc_SEQ;
@@ -1573,6 +1575,24 @@ priv_type INT DEFAULT NULL NULL,
15731575
);
15741576
commit;
15751577

1578+
CREATE SEQUENCE x_sec_zone_ref_role_seq;
1579+
CREATE TABLE x_security_zone_ref_role (
1580+
id BIGINT DEFAULT nextval('x_sec_zone_ref_role_seq'::regclass),
1581+
create_time TIMESTAMP DEFAULT NULL NULL,
1582+
update_time TIMESTAMP DEFAULT NULL NULL,
1583+
added_by_id BIGINT DEFAULT NULL NULL,
1584+
upd_by_id BIGINT DEFAULT NULL NULL,
1585+
zone_id BIGINT DEFAULT NULL NULL,
1586+
role_id BIGINT DEFAULT NULL NULL,
1587+
role_name varchar(255) NULL DEFAULT NULL::character varying,
1588+
primary key (id),
1589+
CONSTRAINT x_sz_ref_role_FK_added_by_id FOREIGN KEY (added_by_id) REFERENCES x_portal_user (id),
1590+
CONSTRAINT x_sz_ref_role_FK_upd_by_id FOREIGN KEY (upd_by_id) REFERENCES x_portal_user (id),
1591+
CONSTRAINT x_sz_ref_role_FK_zone_id FOREIGN KEY (zone_id) REFERENCES x_security_zone (id),
1592+
CONSTRAINT x_sz_ref_role_FK_role_id FOREIGN KEY (role_id) REFERENCES x_role (id)
1593+
);
1594+
commit;
1595+
15761596
CREATE SEQUENCE x_tag_change_log_seq;
15771597

15781598
CREATE TABLE x_tag_change_log (
@@ -1897,6 +1917,7 @@ INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active
18971917
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('059',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
18981918
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('060',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
18991919
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('065',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
1920+
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('075',current_timestamp,'Ranger 3.0.0',current_timestamp,'localhost','Y');
19001921
INSERT INTO x_db_version_h (version,inst_at,inst_by,updated_at,updated_by,active) VALUES ('DB_PATCHES',current_timestamp,'Ranger 1.0.0',current_timestamp,'localhost','Y');
19011922

19021923
INSERT INTO x_user_module_perm (user_id,module_id,create_time,update_time,added_by_id,upd_by_id,is_allowed) VALUES

0 commit comments

Comments
 (0)